#NEWLINE# def currentframe( n = 0 ) : #NEWLINE# #INDENT# "\n    In Python 3, L{inspect.currentframe} does not take a stack-level argument.\n    Restore that functionality from Python 2 so we don't have to re-implement\n    the C{f_back}-walking loop in places where it's called.\n\n    @param n: The number of stack levels above the caller to walk.\n    @type n: L{int}\n\n    @return: a frame, n levels up the stack from the caller.\n    @rtype: L{types.FrameType}\n    " #NEWLINE# f = inspect . currentframe ( ) #NEWLINE# for x in range ( ( f + 1 ) ) : #NEWLINE# #INDENT# f = f . f_back #NEWLINE# #UNINDENT# return f