code: def testPatternShouldOnlyMatch_CandidateLayers(self, model_type):
      pattern = LayerPattern("ReLU", inputs=[LayerPattern("Dense")])
      transform = self.VerifyMatch(pattern)
  
      model = self._simple_dense_model(model_type)
      layer_names = [layer.name for layer in model.layers]
  
      # By default matches everything.
      ModelTransformer(model, [transform]).transform()
      self.assertTrue(transform.matched())
  
      # Matches when all layers passed in.
      transform.reset()
      ModelTransformer(model, [transform], layer_names).transform()
      self.assertTrue(transform.matched())
  
      # Fails. Dense missing.
      transform.reset()
      ModelTransformer(
          model, [transform], [model.layers[-2].name]
      ).transform()
      self.assertFalse(transform.matched())
  
      # Fails. ReLU missing.
      transform.reset()
      ModelTransformer(
          model, [transform], [model.layers[-1].name]
      ).transform()
      self.assertFalse(transform.matched())
  
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 23 for calling the ModelTransformerTest obj's underlying member method code with example usage: obj.testPatternShouldOnlyMatch_CandidateLayers(model_type) without return types