code: def discount_cumsum(x, discount):
      """
      magic from rllab for computing discounted cumulative sums of vectors.
  
      input:
          vector x,
          [x0,
           x1,
           x2]
  
      output:
          [x0 + discount * x1 + discount^2 * x2,
           x1 + discount * x2,
           x2]
      """
      return scipy.signal.lfilter(
          [1], [1, float(-discount)], x[::-1], axis=0
      )[::-1]
  
file_path: spinningup/spinup/algos/tf1/ppo/core.py
imports: import numpy
  import tensorflow
  import scipy.signal
  from gym.spaces import Box, Discrete
label_desc: Use image node_id 10 for calling a global function with example usage: discount_cumsum(x, discount) and returns: scipy