code: def stop_trace(frame=None, close_on_exit=False):
      
      log.info('Stopping trace')
      wdb = Wdb.get(True)  # Do not create an istance if there's None
      if wdb and (not wdb.stepping or close_on_exit):
          log.info('Stopping trace')
          wdb.stop_trace(frame or sys._getframe().f_back)
          if close_on_exit:
              wdb.die()
      return wdb
docs: Stop tracing