(target, source)
return new_callers
Combine two caller lists in a single list.
Combine two caller lists in a single list.
Combine two caller lists in a single list .
def add_callers(target, source):
    """Combine two caller lists in a single list."""
    new_callers = {}
    for func, caller in target.items():
        new_callers[func] = caller
    for func, caller in source.items():
        if func in new_callers:
            if isinstance(caller, tuple):
                # format used by cProfile
                new_callers[func] = tuple(i + j for i, j in zip(caller, new_callers[func]))
            else:
                # format used by profile
                new_callers[func] += caller
        else:
            new_callers[func] = caller
    return new_callers
def add_callers ( target , source ) : new_callers = { } for func , caller in target . items ( ) : new_callers [ func ] = caller for func , caller in source . items ( ) : if func in new_callers : if isinstance ( caller , tuple ) : # format used by cProfile new_callers [ func ] = tuple ( i + j for i , j in zip ( caller , new_callers [ func ] ) ) else : # format used by profile new_callers [ func ] += caller else : new_callers [ func ] = caller return new_callers