MCPcopy Index your code
hub / github.com/OpenBMB/ToolBench / __setitem__

Method __setitem__

toolbench/tooleval/evaluation/dataclass.py:259–272  ·  view source on GitHub ↗
(self,key,value)

Source from the content-addressed store, hash-verified

257 raise IndexError("Invalid number of arguments")
258
259 def __setitem__(self,key,value):
260 if len(key)==0:
261 self.add_node(value)
262 elif isinstance(key, GID):
263 if isinstance(value,ExecutionNode):
264 value.node_id = key
265 self.nodes[key] = value
266 else:
267 raise TypeError('node must be instance of ExecutionNode!')
268
269 elif isinstance(key, tuple) and len(key) == 2:
270 self.add_edge(key[0],key[1],value)
271 else:
272 raise IndexError("Invalid number of arguments")

Callers

nothing calls this directly

Calls 2

add_nodeMethod · 0.95
add_edgeMethod · 0.95

Tested by

no test coverage detected