docstr: Returns a dict {key: array(batch_size x shapes[key])}
          
code: def sample(self, batch_size):
      """Returns a dict {key: array(batch_size x shapes[key])}"""
      buffers = {}
  
      with self.lock:
          assert self.current_size > 0
          for key in self.buffers.keys():
              buffers[key] = self.buffers[key][: self.current_size]
  
      buffers["o_2"] = buffers["o"][:, 1:, :]
      buffers["ag_2"] = buffers["ag"][:, 1:, :]
  
      transitions = self.sample_transitions(buffers, batch_size)
  
      for key in ["r", "o_2", "ag_2"] + list(self.buffers.keys()):
          assert key in transitions, (
              "key %s missing from transitions" % key
          )
  
      return transitions
  
file_path: baselines/baselines/her/replay_buffer.py
imports: import threading
  import numpy
label_desc: Use image node_id 3 for calling the ReplayBuffer obj's underlying member method code with example usage: obj.sample(batch_size) and returns: transitions