code: def hide_me(tb, g=globals()):
      
      base_tb = tb
      try:
          while tb and tb.tb_frame.f_globals is not g:
              tb = tb.tb_next
          while tb and tb.tb_frame.f_globals is g:
              tb = tb.tb_next
      except Exception as e:
          logging.exception(e)
          tb = base_tb
      if not tb:
          tb = base_tb
      return tb
docs: Hide stack traceback of given stack