code: def caller_locals():
      
      import inspect
      frame = inspect.currentframe()
      try:
          return frame.f_back.f_back.f_locals
      finally:
          del frame
docs: Get the local variables in the caller's frame.