def METHOD_NAME(frame, event, arg):
    if frame.f_code.co_filename.startswith(bbbase):
        if not any(te in frame.f_code.co_filename for te in trace_exclusions):
            if event == "call":
                state['indent'] += 2
                print("-" * state['indent'], frame.f_code.co_filename.replace(bbbase, ""),
                      frame.f_code.co_name, frame.f_code.co_varnames, file=f)
            if event == "return":
                state['indent'] -= 2
    return METHOD_NAME