code: def reset(self):
          
  
          if self.resync_period > 0 and (self.resets + 1) % self.resync_period == 0:
              self._exit_resync()
  
          while not self.done:
              self.done = self._quit_episode()
              if not self.done:
                  time.sleep(0.1)
  
          return self._start_up()
docs: gym api reset