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

Function stats_factory

Lib/pstats.py:656–663  ·  view source on GitHub ↗

Return a Stats or SampledStats instance based on the marker in raw_stats.

(raw_stats)

Source from the content-addressed store, hash-verified

654 pass
655
656def stats_factory(raw_stats):
657 """Return a Stats or SampledStats instance based on the marker in raw_stats."""
658 if (('__sampled__',)) in raw_stats:
659 raw_stats = dict(raw_stats) # avoid mutating caller's dict
660 raw_stats.pop((('__sampled__',)))
661 return SampledStats(StatsLoaderShim(raw_stats))
662 else:
663 return Stats(StatsLoaderShim(raw_stats))
664
665if __name__ == '__main__':
666 import cmd

Callers 1

do_readMethod · 0.85

Calls 4

SampledStatsClass · 0.85
StatsLoaderShimClass · 0.85
StatsClass · 0.70
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…