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

Function _graph

tests/test_source_file_encoding.py:142–155  ·  view source on GitHub ↗
(tmp_path: Path, files: dict[str, bytes])

Source from the content-addressed store, hash-verified

140
141
142def _graph(tmp_path: Path, files: dict[str, bytes]):
143 for name, data in files.items():
144 p = tmp_path / name
145 p.parent.mkdir(parents=True, exist_ok=True)
146 p.write_bytes(data)
147 old = os.getcwd()
148 try:
149 os.chdir(tmp_path)
150 r = extract([Path(n) for n in files], cache_root=tmp_path / ".cache")
151 finally:
152 os.chdir(old)
153 nodes = {(n["id"], n["label"]) for n in r["nodes"]}
154 edges = {(e["source"], e["target"], e["relation"]) for e in r["edges"]}
155 return nodes, edges
156
157
158SOURCES = {

Calls 2

extractFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected