docstr: sample a batch from replay memory by indexes
  
  Args:
      batch_idx (list or np.array): batch indexes
  
  Returns:
      a batch of experience samples: obs, action, reward, next_obs, terminal
docstr_tok: ["sample","a","batch","from","replay","memory","by","indexes","Args",":","batch_idx","(","list","or","np.array",")",":","batch","indexes","Returns",":","a","batch","of","experience","samples",":","obs",",","action",",","reward",",","next_obs",",","terminal"]
code: def sample_batch_by_index(self, batch_idx):
      """sample a batch from replay memory by indexes
  
      Args:
          batch_idx (list or np.array): batch indexes
  
      Returns:
          a batch of experience samples: obs, action, reward, next_obs, terminal
      """
      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/parl/utils/replay_memory.py
imports: import numpy
  from parl.utils import logger
label_desc: Use image node_id 4 for calling the ReplayMemory obj's underlying member method code with example usage: obj.sample_batch_by_index(batch_idx) and returns: obs,  action,  reward,  next_obs,  terminal