code: def compute_returns(self, value, done, gamma=0.99, gae_lambda=0.95):
      # gamma: discounting factor
      # gae_lambda: Lambda parameter for calculating N-step advantage
      advantages = np.zeros_like(self.rewards)
      lastgaelam = 0
      for t in reversed(range(self.step_nums)):
          if t == self.step_nums - 1:
              nextnonterminal = 1.0 - done
              nextvalues = value.reshape(1, -1)
          else:
              nextnonterminal = 1.0 - self.dones[t + 1]
              nextvalues = self.values[t + 1]
          delta = (
              self.rewards[t]
              + gamma * nextvalues * nextnonterminal
              - self.values[t]
          )
          advantages[t] = lastgaelam = (
              delta + gamma * gae_lambda * nextnonterminal * lastgaelam
          )
      returns = advantages + self.values
      self.returns = returns
      self.advantages = advantages
      return advantages, returns
  
imports: import numpy
label_desc: Use image node_id 3 for calling the RolloutStorage obj's underlying member method code with example usage: obj.compute_returns(value, done, gamma, gae_lambda) and returns: advantages,  returns