code: def test_moments(self):
      values = [5.0, 7.0]
      decay = 0.9
      d = decay
  
      init_state, update = moving_averages.create_ema(decay=decay)
      state = init_state(values[0])
      moments, state = update(values[0], state)
  
      np.testing.assert_allclose(moments.mean, values[0], atol=1e-5)
      np.testing.assert_allclose(moments.variance, 0.0, atol=1e-5)
  
      moments, state = update(values[1], state)
      np.testing.assert_allclose(
          moments.mean,
          (d * (1 - d) * values[0] + (1 - d) * values[1])
          / (1 - d**2),
          atol=1e-5,
      )
      np.testing.assert_allclose(
          moments.variance,
          (d * (1 - d) * values[0] ** 2 + (1 - d) * values[1] ** 2)
          / (1 - d**2)
          - moments.mean**2,
          atol=1e-4,
      )
  
imports: from absl.testing import absltest
  import numpy
  from rlax._src import moving_averages
label_desc: Use image node_id 1 for calling the EmaTest obj's underlying member method code with example usage: obj.test_moments() without return types