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

Function _large_graph

tests/test_html_large.py:21–42  ·  view source on GitHub ↗
(n: int = 6001)

Source from the content-addressed store, hash-verified

19
20
21def _large_graph(n: int = 6001):
22 G = nx.Graph()
23 for i in range(n):
24 G.add_node(
25 f"n{i}",
26 label=f"Node {i}",
27 source_file=f"src/file{i % 50}.py",
28 file_type="code",
29 )
30 for i in range(n):
31 G.add_edge(
32 f"n{i}",
33 f"n{(i * 7 + 1) % n}",
34 relation="calls",
35 confidence="EXTRACTED" if i % 2 else "INFERRED",
36 )
37 communities = {
38 i: [f"n{j}" for j in range(i * 100, min(n, (i + 1) * 100))]
39 for i in range((n + 99) // 100)
40 }
41 labels = {cid: f"Community {cid}" for cid in communities}
42 return G, communities, labels
43
44
45def _meta_and_payload(html: str):

Calls 2

add_nodeMethod · 0.95
add_edgeMethod · 0.95

Tested by

no test coverage detected