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

Function compare_lists

scripts/compare_backend_snapshots.py:96–111  ·  view source on GitHub ↗
(path: str, neo_list: List[Any], kuzu_list: List[Any])

Source from the content-addressed store, hash-verified

94
95
96def compare_lists(path: str, neo_list: List[Any], kuzu_list: List[Any]) -> Dict[str, Any]:
97 neo_items = [canonical_json(normalize_json(v)) for v in neo_list]
98 kuzu_items = [canonical_json(normalize_json(v)) for v in kuzu_list]
99
100 neo_set = set(neo_items)
101 kuzu_set = set(kuzu_items)
102
103 return {
104 "path": path,
105 "missing_in_kuzu": sorted(neo_set - kuzu_set),
106 "extra_in_kuzu": sorted(kuzu_set - neo_set),
107 "neo_count": len(neo_list),
108 "kuzu_count": len(kuzu_list),
109 "neo_unique": len(neo_set),
110 "kuzu_unique": len(kuzu_set),
111 }
112
113
114def compare_json_recursive(neo: Any, kuzu: Any, path: str = "$") -> Dict[str, List[Any]]:

Callers 1

compare_json_recursiveFunction · 0.85

Calls 2

canonical_jsonFunction · 0.85
normalize_jsonFunction · 0.85

Tested by

no test coverage detected