code: def reset(self):
          
          state = self.sample()
          if state is None:
              # None indicates that a normal env reset should occur
              return self.env.reset()
          else:
              if self.need_xml:
                  # reset the simulation from the model if necessary
                  state, xml = state
                  self.env.reset_from_xml_string(xml)
  
              if isinstance(state, tuple):
                  state = state[0]
  
              # force simulator state to one from the demo
              self.sim.set_state_from_flattened(state)
              self.sim.forward()
  
              return self.env._get_observation()
docs: Logic for sampling a state from the demonstration and resetting
          the simulation to that state.