Return the `calls` edge whose source/target labels contain the given substrings, or None.
(graph: dict, src_label_sub: str, tgt_label_sub: str)
| 45 | |
| 46 | |
| 47 | def _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 | |
| 61 | def _call_edges_matching(graph: dict, src_label: str, tgt_label: str) -> list[dict]: |
no test coverage detected