code: def prune_model(original_model, train_images, train_labels):
      batch_size = 256
      epochs = 5
  
      pruning_params = {
          "pruning_schedule": pruning_schedule.ConstantSparsity(
              0.75, begin_step=0, frequency=100
          )
      }
      pruning_model = prune.prune_low_magnitude(
          original_model, **pruning_params
      )
      pruning_model.summary()
  
      callbacks = [pruning_callbacks.UpdatePruningStep()]
      fit_kwargs = {
          "batch_size": batch_size,
          "epochs": epochs,
          "callbacks": callbacks,
      }
      compile_and_fit(
          pruning_model,
          train_images,
          train_labels,
          compile_kwargs={},
          fit_kwargs=fit_kwargs,
      )
  
      return pruning_model
  
file_path: model-optimization/tensorflow_model_optimization/python/examples/quantization_with_sparsity/keras/mnist_cnn.py
imports: from __future__ import print_function
  from absl import app
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.prune_preserve import default_8bit_prune_preserve_quantize_scheme
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_callbacks
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
label_desc: Use image node_id 4 for calling a global function with example usage: prune_model(original_model, train_images, train_labels) and returns: pruning_model