code: def test_discount_with_boundaries():
      gamma = 0.9
      x = np.array([1.0, 2.0, 3.0, 4.0], "float32")
      starts = [1.0, 0.0, 0.0, 1.0]
      y = discount_with_boundaries(x, starts, gamma)
      assert np.allclose(
          y, [1 + gamma * 2 + gamma**2 * 3, 2 + gamma * 3, 3, 4]
      )
  
file_path: baselines/baselines/common/math_util.py
imports: import numpy
  import scipy.signal
label_desc: Use image node_id 8 for calling a global function with example usage: test_discount_with_boundaries() without return types