helper method for generating nodeselector dict
        :param nodeselector_str:
        :return: dict
198404
def generate_nodeselector_dict(self, nodeselector_str):
        
        nodeselector = {}
        if nodeselector_str and nodeselector_str != 'none':
            constraints = [x.strip() for x in nodeselector_str.split(',')]
            raw_nodeselector = dict([constraint.split('=', 1) for constraint in constraints])
            nodeselector = dict([k.strip(), v.strip()] for (k, v) in raw_nodeselector.items())

        return nodeselector
307988
def selectedNodes( self ):
        
        output = []
        for item in self.selectedItems():
            if ( isinstance(item, XNode) ):
                output.append(item)
        return output
1372457
def get_node_id(nuc_or_sat, namespace=None):
    """"""
    node_type = get_node_type(nuc_or_sat)
    if node_type == 'leaf':
        leaf_id = nuc_or_sat[0].leaves()[0]
        if namespace is not None:
            return '{0}:{1}'.format(namespace, leaf_id)
        else:
            return string(leaf_id)

    #else: node_type == 'span'
    span_start = nuc_or_sat[0].leaves()[0]
    span_end = nuc_or_sat[0].leaves()[1]
    if namespace is not None:
        return '{0}:span:{1}-{2}'.format(namespace, span_start, span_end)
    else:
        return 'span:{0}-{1}'.format(span_start, span_end)
905272
def get_node_list(self) -> list:
        
        # Initialising empty list
        nodes = []

        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node '
                               'can retrieve all the nodes.')

        node_list = self._client.nodes.list()
        for n_list in node_list:
            nodes.append(n_list.id)
        return nodes
1267438
def elementTypeName(self):
        
        fieldName = self.nodeName
        return str(self._ncVar.dtype.fields[fieldName][0])
1008700
def nodeListGetString(self, list, inLine):
        
        if list is None: list__o = None
        else: list__o = list._o
        ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
        return ret
640075
def _parseSelector(self, src):
        
        src, selector = self._parseSimpleSelector(src)
        srcLen = len(src) # XXX
        while src[:1] not in ('', ',', ';', '{', '}', '[', ']', '(', ')'):
            for combiner in self.SelectorCombiners:
                if src.startswith(combiner):
                    src = src[len(combiner):].lstrip()
                    break
            else:
                combiner = ' '
            src, selectorB = self._parseSimpleSelector(src)

            # XXX Fix a bug that occured here e.g. : .1 {...}
            if len(src) >= srcLen:
                src = src[1:]
                while src and (src[:1] not in ('', ',', ';', '{', '}', '[', ']', '(', ')')):
                    src = src[1:]
                return src.lstrip(), None

            selector = self.cssBuilder.combineSelectors(selector, combiner, selectorB)

        return src.lstrip(), selector
983116
def get_node_details(self, node_id: list) -> dict:
        
        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node can '
                               'retrieve node details.')

        node = self._client.nodes.get(node_id)
        return node.attrs
607504
def get_methodnames(self, node):
        '''
        '''
        nodekey = self.get_nodekey(node)
        prefix = self._method_prefix
        if isinstance(nodekey, self.GeneratorType):
            for nodekey in nodekey:
                yield self._method_prefix + nodekey
        else:
            yield self._method_prefix + nodekey
716277
def _gen_net_xml(name,
                 bridge,
                 forward,
                 vport,
                 tag=None):
    '''
    
    '''
    context = {
        'name': name,
        'bridge': bridge,
        'forward': forward,
        'vport': vport,
        'tag': tag,
    }
    fn_ = 'libvirt_network.jinja'
    try:
        template = JINJA.get_template(fn_)
    except jinja2.exceptions.TemplateNotFound:
        log.error('Could not load template %s', fn_)
        return ''
    return template.render(**context)
828594
def _getText(nodelist):
    '''
    
    '''
    rc = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)
350331
def get_nodes(self, request, *args, **kwargs):
        
        # ListSerializerMixin.list returns a serializer object
        return (self.list(request, *args, **kwargs)).data
1141493
def get_node_list(self):
        
        node_objs = list()

        for obj_dict_list in self.obj_dict['nodes'].values():
            node_objs.extend([
                Node(obj_dict=obj_d)
                for obj_d
                in obj_dict_list])

        return node_objs
446851
def node_to_dict(node):
    
    dic = dict(tag=striptag(node.tag))
    if node.attrib:
        dic['attrib'] = node.attrib
    if node.text is not None:
        dic['text'] = node.text
    if node.nodes:
        dic['nodes'] = [node_to_dict(n) for n in node]
    return dic
1276158
def _buildElementTree(self,):
        
        t_binder = ctree.Element(self.name)

        for k,v in self.__dict__.items():
            if k not in ('name', 'urls', 'inputs', 'paging') and v :
                t_binder.set(k,v)

        self.etree = t_binder
        return t_binder
232556
def node_contents_str(tag):
    
    if not tag:
        return None
    tag_string = ''
    for child_tag in tag.children:
        if isinstance(child_tag, Comment):
            # BeautifulSoup does not preserve comment tags, add them back
            tag_string += '<!--%s-->' % unicode_value(child_tag)
        else:
            tag_string += unicode_value(child_tag)
    return tag_string if tag_string != '' else None
9897
def _csv_to_nodes_dict(nodes_csv):
    

    data = []

    for row in csv.reader(nodes_csv):
        node = {
            "pm_user": row[2],
            "pm_addr": row[1],
            "pm_password": row[3],
            "pm_type": row[0],
            "mac": [
                row[4]
            ]
        }
        data.append(node)

    return data