code: def testPrunesModel_CustomTrainingLoop_ReachesTargetSparsity(self):
      pruned_model = prune.prune_low_magnitude(
          keras_test_utils.build_simple_dense_model(),
          pruning_schedule=pruning_schedule.ConstantSparsity(
              target_sparsity=0.5, begin_step=0, frequency=1
          ),
      )
  
      batch_size = 20
      x_train = np.random.rand(20, 10)
      y_train = keras.utils.to_categorical(
          np.random.randint(5, size=(batch_size, 1)), 5
      )
  
      loss = keras.losses.categorical_crossentropy
      optimizer = keras.optimizers.SGD()
  
      unused_arg = -1
  
      step_callback = pruning_callbacks.UpdatePruningStep()
      step_callback.set_model(pruned_model)
      pruned_model.optimizer = optimizer
  
      step_callback.on_train_begin()
      # 2 epochs
      for _ in range(2):
          step_callback.on_train_batch_begin(batch=unused_arg)
          inp = np.reshape(
              x_train, [batch_size, 10]
          )  # original shape: from [10].
          with tf.GradientTape() as tape:
              logits = pruned_model(inp, training=True)
              loss_value = loss(y_train, logits)
              grads = tape.gradient(
                  loss_value, pruned_model.trainable_variables
              )
              optimizer.apply_gradients(
                  zip(grads, pruned_model.trainable_variables)
              )
          step_callback.on_epoch_end(batch=unused_arg)
  
      test_utils.assert_model_sparsity(self, 0.5, pruned_model)
  
imports: import tempfile
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import test_utils
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import prune_registry
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_callbacks
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
  from tensorflow_model_optimization.python.core.sparsity.keras import test_utils
label_desc: Use image node_id 1 for calling the PruneIntegrationCustomTrainingLoopTest obj's underlying member method code with example usage: obj.testPrunesModel_CustomTrainingLoop_ReachesTargetSparsity() without return types