MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / add_callers

Function add_callers

tools/python-3.11.9-amd64/Lib/pstats.py:578–593  ·  view source on GitHub ↗

Combine two caller lists in a single list.

(target, source)

Source from the content-addressed store, hash-verified

576 add_callers(t_callers, callers))
577
578def add_callers(target, source):
579 """Combine two caller lists in a single list."""
580 new_callers = {}
581 for func, caller in target.items():
582 new_callers[func] = caller
583 for func, caller in source.items():
584 if func in new_callers:
585 if isinstance(caller, tuple):
586 # format used by cProfile
587 new_callers[func] = tuple(i + j for i, j in zip(caller, new_callers[func]))
588 else:
589 # format used by profile
590 new_callers[func] += caller
591 else:
592 new_callers[func] = caller
593 return new_callers
594
595def count_calls(callers):
596 """Sum the caller statistics to get total number of calls received."""

Callers 1

add_func_statsFunction · 0.85

Calls 2

tupleClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected