code: def sample_batch(self, idx):
      # flatten rollout
      b_obs = self.obs.reshape((-1,) + self.obs_space.shape)
      b_logprobs = self.logprobs.reshape(-1)
      b_actions = self.actions.reshape((-1,) + self.act_space.shape)
      b_advantages = self.advantages.reshape(-1)
      b_returns = self.returns.reshape(-1)
      b_values = self.values.reshape(-1)
  
      return (
          b_obs[idx],
          b_actions[idx],
          b_logprobs[idx],
          b_advantages[idx],
          b_returns[idx],
          b_values[idx],
      )
  
imports: import numpy
label_desc: Use image node_id 4 for calling the RolloutStorage obj's underlying member method code with example usage: obj.sample_batch(idx) and returns: b_obs,  b_actions,  b_logprobs,  b_advantages,  b_returns,  b_values