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

Function _make_graph

tests/test_benchmark.py:11–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def _make_graph() -> nx.Graph:
12 G = nx.Graph()
13 G.add_node("n1", label="authentication", source_file="auth.py", source_location="L1", community=0)
14 G.add_node("n2", label="api_handler", source_file="api.py", source_location="L5", community=0)
15 G.add_node("n3", label="main_entry", source_file="main.py", source_location="L1", community=1)
16 G.add_node("n4", label="error_handler", source_file="errors.py", source_location="L1", community=1)
17 G.add_node("n5", label="database_layer", source_file="db.py", source_location="L1", community=2)
18 G.add_edge("n1", "n2", relation="calls", confidence="INFERRED")
19 G.add_edge("n2", "n3", relation="imports", confidence="EXTRACTED")
20 G.add_edge("n3", "n4", relation="uses", confidence="EXTRACTED")
21 G.add_edge("n5", "n2", relation="provides", confidence="EXTRACTED")
22 return G
23
24
25def _write_graph(G: nx.Graph, path) -> None:

Calls 2

add_nodeMethod · 0.95
add_edgeMethod · 0.95

Tested by

no test coverage detected