docstr: sample a batch from replay memory
  
  Args:
      batch_size (int): batch size
  
  Returns:
      a batch of experience samples: obs, action, reward, next_obs, terminal
docstr_tok: ["sample","a","batch","from","replay","memory","Args",":","batch_size","(","int",")",":","batch","size","Returns",":","a","batch","of","experience","samples",":","obs",",","action",",","reward",",","next_obs",",","terminal"]
code: def sample_batch(self, batch_size):
      """sample a batch from replay memory
  
      Args:
          batch_size (int): batch size
  
      Returns:
          a batch of experience samples: obs, action, reward, next_obs, terminal
      """
      batch_idx = np.random.randint(self._curr_size, size=batch_size)
  
      obs = self.obs[batch_idx]
      reward = self.reward[batch_idx]
      action = self.action[batch_idx]
      next_obs = self.next_obs[batch_idx]
      terminal = self.terminal[batch_idx]
      return obs, action, reward, next_obs, terminal
  
file_path: PARL/benchmark/torch/iql/replay_buffer.py
imports: import numpy
  from parl.utils import logger
  import d4rl
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling the ReplayMemory obj's underlying member method code with example usage: obj.sample_batch(batch_size) and returns: obs,  action,  reward,  next_obs,  terminal