code: def testAssignMovingAverage(self):
      var = variables.Variable([0.0, 0.0])
      val = constant_op.constant([1.0, 2.0], dtypes.float32)
      decay = 0.25
      if context.executing_eagerly():
          self.assertAllClose([0.0, 0.0], self.evaluate(var))
          assign = moving_averages.assign_moving_average(
              var, val, decay
          )
          self.assertAllClose(
              [
                  1.0 * (1.0 - 0.25) / (1 - 0.25),
                  2.0 * (1.0 - 0.25) / (1 - 0.25),
              ],
              self.evaluate(var),
          )
      else:
          assign = moving_averages.assign_moving_average(
              var, val, decay
          )
          self.evaluate(variables.global_variables_initializer())
          self.assertAllClose([0.0, 0.0], self.evaluate(var))
          assign.op.run()
          self.assertAllClose(
              [
                  1.0 * (1.0 - 0.25) / (1 - 0.25),
                  2.0 * (1.0 - 0.25) / (1 - 0.25),
              ],
              self.evaluate(var),
          )
  
imports: import numpy
  from tensorflow.python.compiler.xla.experimental import xla_sharding
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_state_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import moving_averages
  from tensorflow.python.training import saver
label_desc: Use image node_id 2 for calling the MovingAveragesTest obj's underlying member method code with example usage: obj.testAssignMovingAverage() without return types