human
I wrote the below code

    def run():
        function(*args, **kwargs)
    if (not hasattr(function, '__call__')):
        raise TypeError(('%s    is    not    a    function' % type(function)))
    try:
        import cProfile as profile
    except:
        import profile
    import pstats
    import os
    import sys
    sys.modules['__main__'].__profile_run__ = run
    id = (function.__name__ + '()')
    profile.run('__profile_run__()', id)
    p = pstats.Stats(id)
    p.stream = open(id, 'w')
    p.sort_stats('cumulative').print_stats(30)
    p.stream.close()
    s = open(id).read()
    os.remove(id)
    return s

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def profile(function, *args, **kwargs):