Searches a node from the database for a given key
503338
public Node searchNode(Object key, EntityMetadata m, GraphDatabaseService graphDb, boolean skipProxy)
    {
        Node node = null;
        String idColumnName = ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName();

        final MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                m.getPersistenceUnit());
        if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
        {
            key = serializeIdAttributeValue(m, metaModel, key);
        }

        if (indexer.isNodeAutoIndexingEnabled(graphDb))
        {
            // Get the Node auto index
            ReadableIndex<Node> autoNodeIndex = graphDb.index().getNodeAutoIndexer().getAutoIndex();
            IndexHits<Node> nodesFound = autoNodeIndex.get(idColumnName, key);
            node = getMatchingNodeFromIndexHits(nodesFound, skipProxy);
        }
        else
        {
            // Searching within manually created indexes
            Index<Node> nodeIndex = graphDb.index().forNodes(m.getIndexName());
            IndexHits<Node> nodesFound = nodeIndex.get(idColumnName, key);
            node = getMatchingNodeFromIndexHits(nodesFound, skipProxy);
        }

        return node;
    }
395705
function(key, callback) {
      api.search({
        key: key,
        limit: this.conf.CONST.SEARCH_LIMIT
      }, callback);
    }
838895
def nextKey(self, key):
        """"""
        ans = self.nextNode(key)
        return (ans.key
                if ans is not None
                else None)
1036755
def find_nodes(self, query_dict=None, exact=False, verbose=False, **kwargs):
        """"""
        assert self.use_v1
        return self._do_query('{p}/singlePropertySearchForTreeNodes'.format(p=self.query_prefix),
                              query_dict=query_dict,
                              exact=exact,
                              verbose=verbose,
                              valid_keys=self.node_search_term_set,
                              kwargs=kwargs)
137130
def get_item(self, key):
        
        result = self._db.search(self._urls.key == key)
        return result[0].get('url') if result else None
992921
def query(self, name, node):
        
        #log.debug('searching schema for (%s)', name)
        qref = qualify(name, node, node.namespace())
        query = BlindQuery(qref)
        result = query.execute(self.schema)
        return (result, [])
812575
public function visit($query, $node, string $context)
    {
        if ($node instanceof $this->node) {
            $column = null;
            $values = null;

            if ($node->getChildByIndex(0) instanceof Nodes\KeyNode) {
                $column = $this->parseKey($node->getChildByIndex(0)->getValue());
            }

            if ($node->getChildByIndex(1) instanceof Nodes\GroupNode) {
                $values = array_map(function ($node) {
                    return $this->parseValue($node->getValue());
                }, $node->getChildByIndex(1)->getChildren());
            }

            if ($column && $values) {
                $context === Nodes\OrNode::class && $query->orWhereIn($column, $values);
                $context === Nodes\AndNode::class && $query->whereIn($column, $values);
            }
        }
    }
733695
Node<K,V> find(int h, Object k) {
            Node<K,V> e = this;
            if (k != null) {
                do {
                    K ek;
                    if (e.hash == h &&
                        ((ek = e.key) == k || (ek != null && k.equals(ek))))
                        return e;
                } while ((e = e.next) != null);
            }
            return null;
        }
69909
def find(self, *args, **kwargs):
    " "
    return Query(*args, db=self, schema=self.schema)
32099
def remove(key)
      node = self

      while node do
        # Find index of the entry that best fits the key.
        i = node.search_key_index(key)
        if node.is_leaf
          # This is a leaf node. Check if there is an exact match for the
          # given key and return the corresponding value or nil.
          if node.keys[i] == key
            return node.remove_element(i)
          else
            return nil
          end
        end

        # Descend into the right child node to continue the search.
        node = node.children[i]
      end

      PEROBS.log.fatal 'Could not find proper node to remove from'
    end
320731
public static Node searchNodeById(Node rootNode, int nodeId) {
        if (rootNode.getNodeId() == nodeId) {
            return rootNode;
        }
        Node foundNode = null;
        for (Node n : rootNode.getChilds()) {
            foundNode = searchNodeById(n, nodeId);
            if (foundNode != null) {
                break;
            }
        }
        return foundNode;
    }
1298348
def _search_tree(self, name):
        """"""
        tpl1 = "{sep}{name}{sep}".format(sep=self._node_separator, name=name)
        tpl2 = "{sep}{name}".format(sep=self._node_separator, name=name)
        tpl3 = "{name}{sep}".format(sep=self._node_separator, name=name)
        return sorted(
            [
                node
                for node in self._db
                if (tpl1 in node)
                or node.endswith(tpl2)
                or node.startswith(tpl3)
                or (name == node)
            ]
        )
307305
def node_chain(key)
      node = myself
      list = [ node ]

      while node do
        # Find index of the entry that best fits the key.
        i = node.search_key_index(key)
        if node.is_leaf?
          # This is a leaf node. Check if there is an exact match for the
          # given key and return the corresponding value or nil.
          return node.keys[i] == key ? list : []
        end

        # Add current node to chain.
        list << node
        # Descend into the right child node to continue the search.
        node = node.children[i]
      end

      PEROBS.log.fatal "Could not find node chain for key #{key}"
    end
387847
private Object findByKey(String key) {
		Object value = Config.get(request, key);
		if (value != null) {
			return value;
		}

		value = Config.get(request.getSession(createNewSession()), key);
		if (value != null) {
			return value;
		}

		value = Config.get(request.getServletContext(), key);
		if (value != null) {
			return value;
		}

		return request.getServletContext().getInitParameter(key);
	}
531154
function lookup(tree, key) {
  if (!tree) {
    return null
  }

  switch (compare(tree.key, key)) {
    case 0:
      return tree
    case 1:
      return lookup(tree.right, key)
    case -1:
      return lookup(tree.left, key)
    default:
      break
  }
}
1368922
protected void searchNode(P target, KdTree.Node n) {
		while( n != null) {
			checkBestDistance(n, target);

			if( n.isLeaf() )
				break;

			// select the most promising branch to investigate first
			KdTree.Node nearer,further;

			double splitValue = distance.valueAt( (P)n.point , n.split );

			if( distance.valueAt( target , n.split ) <= splitValue ) {
				nearer = n.left;
				further = n.right;
			} else {
				nearer = n.right;
				further = n.left;
			}

			// See if it is possible for 'further' to contain a better node
			double dx = splitValue - distance.valueAt(target, n.split );
			if( further != null && canImprove(dx*dx) ) {
				addToQueue(dx*dx, further, target );
			}

			n = nearer;
		}
	}
1165055
def select_node(**kw):
    
    with current_app.app_context():
        result = db.execute(text(fetch_query_string('select_node_from_id.sql')), **kw).fetchall()
        return result