Return a Stats or SampledStats instance based on the marker in raw_stats.
(raw_stats)
| 654 | pass |
| 655 | |
| 656 | def 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 | |
| 665 | if __name__ == '__main__': |
| 666 | import cmd |
no test coverage detected
searching dependent graphs…