MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _method_node_id

Function _method_node_id

tests/test_pascal_call_scoping.py:31–39  ·  view source on GitHub ↗
(r, class_label, method_label)

Source from the content-addressed store, hash-verified

29
30
31def _method_node_id(r, class_label, method_label):
32 class_id = _class_node_id(r, class_label)
33 node_by_id = {n["id"]: n for n in r["nodes"]}
34 for e in r["edges"]:
35 if e["relation"] == "method" and e["source"] == class_id:
36 node = node_by_id.get(e["target"])
37 if node and node["label"] == method_label:
38 return node["id"]
39 raise AssertionError(f"no method edge {class_label}.{method_label} found")
40
41
42def _has_call(r, src_id, tgt_id):

Calls 2

_class_node_idFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected