code: def test_serialization():
      if hasattr(tf.keras.optimizers, "legacy"):
          sgd_opt = tf.keras.optimizers.legacy.SGD(
              lr=2.0, nesterov=True, momentum=0.3, decay=0.1
          )
      else:
          sgd_opt = tf.keras.optimizers.SGD(
              lr=2.0, nesterov=True, momentum=0.3, decay=0.1
          )
      optimizer = MovingAverage(
          sgd_opt,
          average_decay=0.5,
          num_updates=None,
          start_step=5,
          dynamic_decay=True,
      )
      config = tf.keras.optimizers.serialize(optimizer)
      new_optimizer = tf.keras.optimizers.deserialize(config)
      assert new_optimizer.get_config() == optimizer.get_config()
  
imports: import numpy
  import pytest
  import tensorflow
  from packaging.version import Version
  from tensorflow_addons.optimizers import MovingAverage
label_desc: Use image node_id 10 for calling a global function with example usage: test_serialization() without return types