code: def testReplaceChainOfLayers_WithChainOfLayers(self, model_type):
      class Replace2DenseLayers(transforms.Transform):
          """Replaces 2 Dense layers with the same dense layers.
  
          Doesn't make any meaningful change to the layer. Just verifies that
          replacing multiple layers works as expected.
          """
  
          def pattern(self):
              return LayerPattern(
                  "Dense", inputs=[LayerPattern("Dense")]
              )
  
          def replacement(self, match_layer):
              # Adds a modification so the transform happens. If the layers are
              # exactly the same, they get ignored by transformer.
              match_layer.metadata["key"] = "value"
              return match_layer
  
      if model_type == "functional":
          inp = keras.layers.Input((3,))
          x = keras.layers.Dense(3)(inp)
          x = keras.layers.Dense(2)(x)
          model = keras.Model(inp, x)
      else:
          model = keras.Sequential(
              [
                  keras.layers.Dense(3, input_shape=(3,)),
                  keras.layers.Dense(2),
              ]
          )
  
      transformed_model, _ = ModelTransformer(
          model, [Replace2DenseLayers()]
      ).transform()
  
      self._assert_model_results_equal(model, transformed_model)
  
      # build_input_shape is a TensorShape object and the two objects are not
      # considered the same even though the shapes are the same.
      self._assert_config(
          model.get_config(),
          transformed_model.get_config(),
          ["build_input_shape"],
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import utils
  from tensorflow_model_optimization.python.core.quantization.keras.graph_transformations import model_transformer
  from tensorflow_model_optimization.python.core.quantization.keras.graph_transformations import transforms
label_desc: Use image node_id 16 for calling the ModelTransformerTest obj's underlying member method code with example usage: obj.testReplaceChainOfLayers_WithChainOfLayers(model_type) and returns: LayerPattern, match_layer