I am using following answer related to In Python, how do I obtain the current frame?
def WHERE( back = 0 ): frame = sys._getframe( back + 1 )