MCPcopy Index your code
hub / github.com/python/cpython / output_stats

Function output_stats

Tools/scripts/summarize_stats.py:1496–1514  ·  view source on GitHub ↗
(inputs: list[Path], json_output=str | None)

Source from the content-addressed store, hash-verified

1494
1495
1496def output_stats(inputs: list[Path], json_output=str | None):
1497 match len(inputs):
1498 case 1:
1499 data = load_raw_data(Path(inputs[0]))
1500 if json_output is not None:
1501 with open(json_output, "w", encoding="utf-8") as f:
1502 save_raw_data(data, f) # type: ignore
1503 stats = Stats(data)
1504 output_markdown(sys.stdout, LAYOUT, stats)
1505 case 2:
1506 if json_output is not None:
1507 raise ValueError(
1508 "Can not output to JSON when there are multiple inputs"
1509 )
1510 base_data = load_raw_data(Path(inputs[0]))
1511 head_data = load_raw_data(Path(inputs[1]))
1512 base_stats = Stats(base_data)
1513 head_stats = Stats(head_data)
1514 output_markdown(sys.stdout, LAYOUT, base_stats, head_stats)
1515
1516
1517def main():

Callers 1

mainFunction · 0.85

Calls 6

PathClass · 0.90
load_raw_dataFunction · 0.85
save_raw_dataFunction · 0.85
output_markdownFunction · 0.85
StatsClass · 0.70
openFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…