<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def p(name="", **kwargs):
    '''
    really quick and dirty profiling

    you start a profile by passing in name, you stop the top profiling by not
    passing in a name. You can also call this method using a with statement

    This is for when you just want to get a really back of envelope view of
    how your fast your code is, super handy, not super accurate

    since -- 2013-5-9
    example --
        p("starting profile")
        time.sleep(1)
        p() # stop the "starting profile" session

        # you can go N levels deep
        p("one")
        p("two")
        time.sleep(0.5)
        p() # stop profiling of "two"
        time.sleep(0.5)
        p() # stop profiling of "one"

        with pout.p("three"):
            time.sleep(0.5)

    name -- string -- pass this in to start a profiling session
    return -- context manager
    '''
    with Reflect.context(**kwargs) as r:
        if name:
            instance = P_CLASS(r, stream, name, **kwargs)
        else:
            instance = P_CLASS.pop(r)
            instance()

    return instance