code: def get_globals(self):
          
          if self.shell:
              globals_ = dict(_initial_globals)
          else:
              globals_ = dict(self.current_frame.f_globals)
          globals_['_'] = self.db.last_obj
          if cut is not None:
              globals_.setdefault('cut', cut)
          # For meta debuging purpose
          globals_['___wdb'] = self.db
          # Hack for function scope eval
          globals_.update(self.current_locals)
          for var, val in self.db.extra_vars.items():
              globals_[var] = val
          self.db.extra_items = {}
          return globals_
docs: Get enriched globals