code: def testValidateMetricsInvalidThreshold(self):
      eval_config = config_pb2.EvalConfig(
          model_specs=[
              config_pb2.ModelSpec(),
          ],
          slicing_specs=[config_pb2.SlicingSpec()],
          metrics_specs=[
              config_pb2.MetricsSpec(
                  thresholds={
                      "invalid_threshold": config_pb2.MetricThreshold(
                          value_threshold=config_pb2.GenericValueThreshold(
                              lower_bound={"value": 0.2}
                          )
                      )
                  }
              )
          ],
      )
      sliced_metrics = (
          (()),
          {
              metric_types.MetricKey(
                  name="weighted_example_count", example_weighted=True
              ): 1.5,
          },
      )
      result = metrics_validator.validate_metrics(
          sliced_metrics, eval_config
      )
      self.assertFalse(result.validation_ok)
      expected = text_format.Parse(
          """
          metric_validations_per_slice {
            slice_key {
            }
            failures {
              metric_key {
                name: "invalid_threshold"
              }
              metric_threshold {
                value_threshold {
                  lower_bound {
                    value: 0.2
                  }
                }
              }
              message: 'Metric not found.'
            }
          }""",
          validation_result_pb2.ValidationResult(),
      )
      self.assertProtoEquals(expected, result)
  
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.evaluators import metrics_validator
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import validation_result_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the MetricsValidatorTest obj's underlying member method code with example usage: obj.testValidateMetricsInvalidThreshold() without return types