code: def strip_pruning(model):
      """Strip pruning wrappers from the model.
  
      Once a model has been pruned to required sparsity, this method can be used
      to restore the original model with the sparse weights.
  
      Only sequential and functional models are supported for now.
  
      Arguments:
          model: A `tf.keras.Model` instance with pruned layers.
  
      Returns:
        A keras model with pruning wrappers removed.
  
      Raises:
        ValueError: if the model is not a `tf.keras.Model` instance.
        NotImplementedError: if the model is a subclass model.
  
      Usage:
  
      ```python
      orig_model = tf.keras.Model(inputs, outputs)
      pruned_model = prune_low_magnitude(orig_model)
      exported_model = strip_pruning(pruned_model)
      ```
      The exported_model and the orig_model share the same structure.
      """
  
      if not isinstance(model, keras.Model):
          raise ValueError(
              "Expected model to be a `tf.keras.Model` instance but got: ",
              model,
          )
  
      def _strip_pruning_wrapper(layer):
          if isinstance(layer, tf.keras.Model):
              # A keras model with prunable layers
              return keras.models.clone_model(
                  layer,
                  input_tensors=None,
                  clone_function=_strip_pruning_wrapper,
              )
          if isinstance(layer, pruning_wrapper.PruneLowMagnitude):
              # The _batch_input_shape attribute in the first layer makes a Sequential
              # model to be built. This makes sure that when we remove the wrapper from
              # the first layer the model's built state preserves.
              if not hasattr(
                  layer.layer, "_batch_input_shape"
              ) and hasattr(layer, "_batch_input_shape"):
                  layer.layer._batch_input_shape = (
                      layer._batch_input_shape
                  )
              return layer.layer
          return layer
  
      return keras.models.clone_model(
          model,
          input_tensors=None,
          clone_function=_strip_pruning_wrapper,
      )
  
imports: import tensorflow
  from tensorflow_model_optimization.python.core.keras import metrics
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 3 for calling a global function with example usage: strip_pruning(model) and returns: keras, layer, keras, layer