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

Function _decompose

graphify/extract.py:14031–14042  ·  view source on GitHub ↗
(target: str, tf: str)

Source from the content-addressed store, hash-verified

14029 owned_ids = {n.get("id") for n in all_nodes}
14030
14031 def _decompose(target: str, tf: str) -> "tuple[str, str] | None":
14032 try:
14033 forms = stem_forms.get(_walked(tf)) or stem_forms.get(_resolved(tf))
14034 except (OSError, RuntimeError):
14035 return None
14036 if not forms:
14037 return None
14038 canonical, prefixes = forms
14039 for pref in prefixes:
14040 if pref and target.startswith(pref + "_"):
14041 return canonical, target[len(pref) + 1:]
14042 return None
14043
14044 # (canonical file id, symbol) → set of owned targets, learned from
14045 # symbol-level re_exports edges that already point at a real node. A set

Callers 2

_learnFunction · 0.85
extractFunction · 0.85

Calls 3

_walkedFunction · 0.85
_resolvedFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected