code: def test_no_average_slot():
      max_features = 5000
      max_len = 4
      embedding_dims = 2
  
      # Some preprocessing layers have TrackableWeightHandler.
      # They are returned when using model.variables
      # but it's unable to assign average slot to them.
      vectorize_layer = (
          tf.keras.layers.experimental.preprocessing.TextVectorization(
              max_tokens=max_features,
              output_mode="int",
              output_sequence_length=max_len,
          )
      )
  
      vectorize_layer.adapt(["foo", "bar", "baz"])
  
      model = tf.keras.models.Sequential(
          [
              tf.keras.Input(shape=(1,), dtype=tf.string),
              vectorize_layer,
              tf.keras.layers.Embedding(
                  max_features + 1, embedding_dims
              ),
              tf.keras.layers.Dense(1),
          ]
      )
  
      optimizer = MovingAverage("sgd")
  
      model.compile(optimizer, loss="mse")
      model.fit(x=["foo", "bar", "baz"], y=[0.0, 1.0, 2.0], epochs=1)
  
      optimizer.assign_average_vars(model.variables)
  
imports: import numpy
  import pytest
  import tensorflow
  from packaging.version import Version
  from tensorflow_addons.optimizers import MovingAverage
label_desc: Use image node_id 16 for calling a global function with example usage: test_no_average_slot() without return types