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

Method edge

pattern/graph/__init__.py:412–419  ·  view source on GitHub ↗

Returns the edge between the nodes with given id1 and id2.

(self, id1, id2)

Source from the content-addressed store, hash-verified

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.
414 """
415 if isinstance(id1, Node) and id1.graph == self:
416 id1 = id1.id
417 if isinstance(id2, Node) and id2.graph == self:
418 id2 = id2.id
419 return id1 in self and id2 in self and self[id1].links.edge(id2) or None
420
421 def paths(self, node1, node2, length=4, path=[]):
422 """ Returns a list of paths (shorter than or equal to given length) connecting the two nodes.

Callers 3

test_redirectMethod · 0.95
test_cutMethod · 0.95
test_insertMethod · 0.95

Calls 1

edgeMethod · 0.45

Tested by 3

test_redirectMethod · 0.76
test_cutMethod · 0.76
test_insertMethod · 0.76