MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / find_node

Method find_node

KVCOMM/graph/graph.py:122–126  ·  view source on GitHub ↗
(self, id: str)

Source from the content-addressed store, hash-verified

120 return len(self.nodes)
121
122 def find_node(self, id: str):
123 if id in self.nodes.keys():
124 return self.nodes[id]
125 raise Exception(f"Node not found: {id} among "
126 f"{[node.id for node in self.nodes.values()]}")
127
128 def add_node(self, node: Node):
129 node_id = node.id if node.id is not None else shortuuid.ShortUUID().random(length=4)

Calls 2

valuesMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected