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

Method get_call_stats

Tools/scripts/summarize_stats.py:387–402  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

385 )
386
387 def get_call_stats(self) -> dict[str, int]:
388 defines = self._data["_stats_defines"]
389 result = {}
390 for key, value in sorted(self._data.items()):
391 if "Calls to" in key:
392 result[key] = value
393 elif key.startswith("Calls "):
394 name, index = key[:-1].split("[")
395 label = f"{name} ({pretty(defines[int(index)][0])})"
396 result[label] = value
397
398 for key, value in sorted(self._data.items()):
399 if key.startswith("Frame"):
400 result[key] = value
401
402 return result
403
404 def get_object_stats(self) -> dict[str, tuple[int, int]]:
405 total_materializations = self._data.get("Object inline values", 0)

Callers 1

calc_call_stats_tableFunction · 0.80

Calls 4

prettyFunction · 0.70
itemsMethod · 0.45
startswithMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected