code: def sample(self, batch_size):
      # Draw such that we always have a proceeding element.
      batch_idxs = np.random.randint(
          self.nb_entries - 2, size=batch_size
      )
  
      obs0_batch = self.observations0.get_batch(batch_idxs)
      obs1_batch = self.observations1.get_batch(batch_idxs)
      action_batch = self.actions.get_batch(batch_idxs)
      reward_batch = self.rewards.get_batch(batch_idxs)
      terminal1_batch = self.terminals1.get_batch(batch_idxs)
  
      result = {
          "obs0": array_min2d(obs0_batch),
          "obs1": array_min2d(obs1_batch),
          "rewards": array_min2d(reward_batch),
          "actions": array_min2d(action_batch),
          "terminals1": array_min2d(terminal1_batch),
      }
      return result
  
file_path: baselines/baselines/ddpg/memory.py
imports: import numpy
label_desc: Use image node_id 2 for calling the Memory obj's underlying member method code with example usage: obj.sample(batch_size) and returns: result