human
I wrote the below code

    profiler = Profiler()
    profiler.start()
    def handle_signal(signum, frame):
        print profiler.output_text(color=True)
        delattr(profiler, '_root_frame')
    signal.signal(signal.SIGTRAP, handle_signal)

What's a good function header?
assistant
#Here is Python program to print profiler.

def attach_pyinstrument_profiler():