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

Function _method_of

graphify/extract.py:6731–6742  ·  view source on GitHub ↗
(cls: str, callee: str)

Source from the content-addressed store, hash-verified

6729 slot.append(tgt)
6730
6731 def _method_of(cls: str, callee: str) -> "str | None":
6732 # The key folds case and drops `_`, so `run()` and `_run()` of one class
6733 # share it; Python names are exact. Among several, the one named exactly
6734 # `callee` is the call's target, and none or two of them is no edge, as
6735 # in the module arm below (#4577).
6736 hits = method_index.get((cls, _key(callee)), [])
6737 if len(hits) > 1:
6738 hits = [
6739 m for m in hits
6740 if str(node_by_id.get(m, {}).get("label", "")).strip().lstrip(".").removesuffix("()") == callee
6741 ]
6742 return hits[0] if len(hits) == 1 else None
6743
6744 # A class with N methods produced N entries; collapse to a unique set. (No
6745 # early return when there are no classes: the module arm below resolves

Callers 2

_inherited_methodFunction · 0.85

Calls 2

_keyFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected