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

Method append

pattern/graph/__init__.py:339–346  ·  view source on GitHub ↗

Appends a Node or Edge to the graph: Graph.append(Node, id="rabbit").

(self, base, *args, **kwargs)

Source from the content-addressed store, hash-verified

337 raise KeyError, "no node with id '%s' in graph" % id
338
339 def append(self, base, *args, **kwargs):
340 """ Appends a Node or Edge to the graph: Graph.append(Node, id="rabbit").
341 """
342 kwargs["base"] = base
343 if issubclass(base, Node):
344 return self.add_node(*args, **kwargs)
345 if issubclass(base, Edge):
346 return self.add_edge(*args, **kwargs)
347
348 def add_node(self, id, *args, **kwargs):
349 """ Appends a new Node to the graph.

Callers 1

test_copyMethod · 0.95

Calls 2

add_nodeMethod · 0.95
add_edgeMethod · 0.95

Tested by 1

test_copyMethod · 0.76