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

Function _rel

tests/test_cpp_method_declarations.py:40–47  ·  view source on GitHub ↗
(r: dict, relation: str, src: str, tgt: str)

Source from the content-addressed store, hash-verified

38
39
40def _rel(r: dict, relation: str, src: str, tgt: str) -> bool:
41 labels = {n["id"]: str(n.get("label", "")) for n in r["nodes"]}
42 return any(
43 e.get("relation") == relation
44 and labels.get(e.get("source")) == src
45 and labels.get(e.get("target")) == tgt
46 for e in r["edges"]
47 )
48
49
50def _labels(r: dict) -> list[str]:

Calls 1

getMethod · 0.45

Tested by

no test coverage detected