code: def get_reduced_model(
      sample_inputs, hidden_layer_list, new_custom_layers=None
  ):
      """Reduces a set of layers to only core Keras layers in a model."""
      sample_outputs = sample_inputs
      for l in hidden_layer_list:
          sample_outputs = l(sample_outputs)
      custom_model = tf.keras.Model(
          inputs=sample_inputs, outputs=sample_outputs
      )
      if new_custom_layers:
          reduced_outputs = gradient_clipping_utils.generate_model_outputs_using_core_keras_layers(
              custom_model,
              custom_layer_set=new_custom_layers,
          )
      else:
          reduced_outputs = gradient_clipping_utils.generate_model_outputs_using_core_keras_layers(
              custom_model
          )
      return tf.keras.Model(
          inputs=custom_model.inputs, outputs=reduced_outputs
      )
  
imports: from typing import Any
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.fast_gradient_clipping import gradient_clipping_utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_reduced_model(sample_inputs, hidden_layer_list, new_custom_layers) and returns: tf