Return a nodeid by name
422098
def nodeByName(self, name):
        
        # note: really long names are encoded differently:
        #  'N'+'\x00'+pack('Q', nameid)  => ofs
        #  and  (ofs, 'N') -> nameid

        # at nodebase ( 0xFF000000, 'S', 0x100*nameid )  there is a series of blobs for max 0x80000 sized names.
        cur = self.btree.find('eq', self.namekey(name))
        if cur:
            return struct.unpack('<' + self.fmt, cur.getval())[0]
1075173
def get_port_name_from_id(node_id, port_id, nodes):
        
        port_name = ''
        for node in nodes:
            if node['id'] == node_id:
                for port in node['ports']:
                    if port['id'] == port_id:
                        port_name = port['name']
                        break
        return port_name
800487
def get_node(conn, name):
    '''
    
    '''
    datacenter_id = get_datacenter_id()

    for item in conn.list_servers(datacenter_id)['items']:
        if item['properties']['name'] == name:
            node = {'id': item['id']}
            node.update(item['properties'])
            return node
1294635
def add_node_by_name(self, node_name: str, external_id: Optional[str] = None) -> None:
        
        if node_name is None:
            return

        node_name = node_name.strip()
        if len(node_name) == 0:
            return

        node: Node = self.get_node_by_name(node_name, external_id=external_id)
        if node is None:
            self._internal_add_node(node_name=node_name,
                                    external_id=external_id,
                                    are_neighbors_cached=False,
                                    add_to_cache=True)
95410
def find_node_by_id(self, node_list_pyxb, node_id):
        
        for node_pyxb in node_list_pyxb.node:
            # if node_pyxb.baseURL == base_url:
            if d1_common.xml.get_req_val(node_pyxb.identifier) == node_id:
                return node_pyxb
508902
def getElement(self, node, name, nsuri=None, default=join):
        """"""
        nsmatch = self.nsUriMatch
        ELEMENT_NODE = node.ELEMENT_NODE
        for child in node.childNodes:
            if child.nodeType == ELEMENT_NODE:
                if ((child.localName == name or name is None) and
                    (nsuri is None or nsmatch(child.namespaceURI, nsuri))
                    ):
                    return child
        if default is not join:
            return default
        raise KeyError, name
1354442
function() {
        var str = this[UID] + ': not bound to a node',
            node = this._node,
            attrs, id, className;

        if (node) {
            attrs = node.attributes;
            id = (attrs && attrs.id) ? node.getAttribute('id') : null;
            className = (attrs && attrs.className) ? node.getAttribute('className') : null;
            str = node[NODE_NAME];

            if (id) {
                str += '#' + id; 
            }

            if (className) {
                str += '.' + className.replace(' ', '.'); 
            }

            // TODO: add yuid?
            str += ' ' + this[UID];
        }
        return str;
    }
868481
function getNodeFromId(nodeId){
    var res = $.grep(gAllNodes, function(e) {
        return e._id === nodeId;
    });
    return res[0];
}
730635
def getValueByName(node, name):
    

    try:
        value = node.xpath("*[local-name() = '%s']" % name)[0].text.strip()
    except:
        return None
    return value
244788
function (nodes, id) {
            for (var i = 0; i < nodes.length; i++) {
                var attrId = nodes.item(i).getAttribute("id");
                if (!attrId) {
                    continue;
                }
                if (attrId.toString() === id) {
                    return nodes.item(i);
                }
            }
            return null;
        }
652235
def getNodeByName(node, name):
    

    if node is None:
        raise Exception(
            "Cannot search for a child '%s' in a None object" % (name,)
        )
    if not name:
        raise Exception("Unspecified name to find node for.")
    try:
        childNode = node.xpath("*[local-name() = '%s']" % name)[0]
    except:
        return None
    return childNode
886682
def get_node(self, key):
    """"""
    if key in self.names:
      return self.values.get_member_node(key) if hasattr(self.values, 'get_member_node') else None
    return self.parent.get_node(key)
2611
def node_name(node):
    
    return hasattr(node, 'id') and node.id or hasattr(node, 'name') and node.name
1185542
def device_id_from_name(device_name, nodes):
        
        device_id = None
        for node in nodes:
            if device_name == node['properties']['name']:
                device_id = node['id']
                break
        return device_id
838219
def get_node(self, node_id):
        """"""
        try:
            node_object = self.nodes[node_id]
        except KeyError:
            raise NonexistentNodeError(node_id)
        return node_object
284673
public INDArray getById(@NonNull String name) {
        return map.get(NodeDescriptor.builder().name(name).build());
    }
1023609
def get_node_attributes(G, name):
    
    return {n: d[name] for n, d in G.node.items() if name in d}