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

Function declared_in

graphify/interface_dispatch.py:63–75  ·  view source on GitHub ↗

True when the node is a declaration that lives in a file with one of ``suffixes``. Every end of a dispatch pair has to pass this. A sourceless stub minted for a dangling reference carries no members worth dispatching to, and a cross-language pair is a name collision rather than an imple

(node: dict | None, suffixes: tuple[str, ...])

Source from the content-addressed store, hash-verified

61
62
63def declared_in(node: dict | None, suffixes: tuple[str, ...]) -> bool:
64 """True when the node is a declaration that lives in a file with one of ``suffixes``.
65
66 Every end of a dispatch pair has to pass this. A sourceless stub minted for
67 a dangling reference carries no members worth dispatching to, and a
68 cross-language pair is a name collision rather than an implementation. The
69 suffix is the effective one, so a `.graphifyrc` language declaration counts
70 (#2961).
71 """
72 if not node:
73 return False
74 source_file = node.get("source_file")
75 return bool(source_file) and effective_suffix(str(source_file)) in suffixes
76
77
78def method_label(node: dict) -> str:

Callers 2

Calls 2

effective_suffixFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected