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

Function _has_call_edge

tests/test_ruby_resolution.py:47–58  ·  view source on GitHub ↗

Return the `calls` edge whose source/target labels contain the given substrings, or None.

(graph: dict, src_label_sub: str, tgt_label_sub: str)

Source from the content-addressed store, hash-verified

45
46
47def _has_call_edge(graph: dict, src_label_sub: str, tgt_label_sub: str) -> dict | None:
48 """Return the `calls` edge whose source/target labels contain the given
49 substrings, or None."""
50 labels = _labels(graph["nodes"])
51 for e in graph["edges"]:
52 if e.get("relation") != "calls":
53 continue
54 s = labels.get(e.get("source"), "")
55 t = labels.get(e.get("target"), "")
56 if src_label_sub in s and tgt_label_sub in t:
57 return e
58 return None
59
60
61def _call_edges_matching(graph: dict, src_label: str, tgt_label: str) -> list[dict]:

Calls 2

_labelsFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected