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

Function render_summary

Tools/c-analyzer/cpython/_capi.py:621–652  ·  view source on GitHub ↗
(items, *,
                   groupby='kind',
                   sort=None,
                   showempty=None,
                   verbose=False,
                   )

Source from the content-addressed store, hash-verified

619
620
621def render_summary(items, *,
622 groupby='kind',
623 sort=None,
624 showempty=None,
625 verbose=False,
626 ):
627 if groupby is None:
628 groupby = 'kind'
629 summary = summarize(
630 items,
631 groupby=groupby,
632 includeempty=showempty,
633 minimize=None if showempty else not verbose,
634 )
635
636 subtotals = summary['totals']['subs']
637 bygroup = summary['totals']['bygroup']
638 for outer, subtotal in subtotals.items():
639 if bygroup:
640 subtotal = f'({subtotal})'
641 yield f'{outer + ":":20} {subtotal:>8}'
642 else:
643 yield f'{outer + ":":10} {subtotal:>8}'
644 if outer in bygroup:
645 for inner, count in bygroup[outer].items():
646 yield f' {inner + ":":9} {count}'
647 total = f'*{summary["totals"]["all"]}*'
648 label = '*total*:'
649 if bygroup:
650 yield f'{label:20} {total:>8}'
651 else:
652 yield f'{label:10} {total:>9}'
653
654
655_FORMATS = {

Callers

nothing calls this directly

Calls 2

summarizeFunction · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…