code: def test_state_ema(self):
      with hk.variables():
          ema = snt.ExponentialMovingAverage(decay=0.5)
      ema = hk.transform_with_state(ema)
  
      params, state = ema.init(3.0)
      y, state = ema.apply(params, state, 3.0)
      self.assertAllClose(y.numpy(), 3.0)
      y, state = ema.apply(params, state, 6.0)
      self.assertAllClose(y.numpy(), 5.0)
  
imports: from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  from sonnet.src.functional import haiku
  import tensorflow
  import tree
label_desc: Use image node_id 7 for calling the NetworkTest obj's underlying member method code with example usage: obj.test_state_ema() without return types