MCPcopy Index your code
hub / github.com/python/mypy / normalize_json_meta

Function normalize_json_meta

misc/diff-cache.py:88–98  ·  view source on GitHub ↗

Normalize a JSON meta dict to avoid spurious diffs. Zero out mtimes and sort dependencies deterministically.

(obj: dict[str, Any])

Source from the content-addressed store, hash-verified

86
87
88def normalize_json_meta(obj: dict[str, Any]) -> None:
89 """Normalize a JSON meta dict to avoid spurious diffs.
90
91 Zero out mtimes and sort dependencies deterministically.
92 """
93 obj["mtime"] = 0
94 obj["data_mtime"] = 0
95 if "dependencies" in obj:
96 obj["dependencies"], obj["suppressed"], obj["dep_prios"], obj["dep_lines"] = sort_deps(
97 obj["dependencies"], obj["suppressed"], obj["dep_prios"], obj["dep_lines"]
98 )
99
100
101def load(cache: MetadataStore, s: str) -> Any:

Callers 1

loadFunction · 0.85

Calls 1

sort_depsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…