MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _is_node

Function _is_node

src/codegraphcontext/cli/cli_helpers.py:658–667  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

656 return isinstance(value, dict) and _has_meta(value, "_src") and _has_meta(value, "_dst")
657
658 def _is_node(value) -> bool:
659 if hasattr(value, "labels"):
660 return True
661 if hasattr(value, "type"):
662 return False
663 if hasattr(value, "relation") and hasattr(value, "src_node"):
664 return False
665 # Kùzu relationships also carry _label, so _src/_dst is what
666 # distinguishes them from nodes.
667 return isinstance(value, dict) and _has_meta(value, "_label") and not _has_meta(value, "_src")
668
669 def _node_payload(value) -> Dict[str, Any]:
670 if hasattr(value, "labels"):

Callers 1

Calls 1

_has_metaFunction · 0.85

Tested by

no test coverage detected