MCPcopy Index your code
hub / github.com/clips/pattern / node

Method node

pattern/graph/__init__.py:405–410  ·  view source on GitHub ↗

Returns the node in the graph with the given id.

(self, id)

Source from the content-addressed store, hash-verified

403 self._adjacency = None
404
405 def node(self, id):
406 """ Returns the node in the graph with the given id.
407 """
408 if isinstance(id, Node) and id.graph == self:
409 return id
410 return self.get(id, None)
411
412 def edge(self, id1, id2):
413 """ Returns the edge between the nodes with given id1 and id2.

Callers 5

test_graph_nodesMethod · 0.80
test_cacheMethod · 0.80
01-graph.pyFile · 0.80

Calls 1

getMethod · 0.45

Tested by 4

test_graph_nodesMethod · 0.64
test_cacheMethod · 0.64