code: def _reverse_sample_open_loop(self):
          
  
          # get a random episode index
          ep_ind = random.choice(self.demo_list)
  
          # sample uniformly in a window that grows backwards from the end of the demos
          states = self.demo_file["data/{}/states".format(ep_ind)].value
          eps_len = states.shape[0]
          index = np.random.randint(max(eps_len - self.open_loop_window_size, 0), eps_len)
          state = states[index]
  
          # increase window size at a fixed frequency (open loop)
          self.demo_sampled += 1
          if self.demo_sampled >= self.open_loop_increment_freq:
              if self.open_loop_window_size < eps_len:
                  self.open_loop_window_size += self.open_loop_window_increment
              self.demo_sampled = 0
  
          if self.need_xml:
              model_xml = self._xml_for_episode_index(ep_ind)
              xml = postprocess_model_xml(model_xml)
              return state, xml
  
          return state
docs: Sampling method.
  
          Open loop reverse sampling from demonstrations. Starts by 
          sampling from states near the end of the demonstrations.
          Increases the window backwards as the number of calls to
          this sampling method increases at a fixed rate.