code: def testValidateMetricsCrossSliceThresholdFail(
      self, cross_slicing_specs, slice_key
  ):
      threshold = config_pb2.MetricThreshold(
          value_threshold=config_pb2.GenericValueThreshold(
              upper_bound={"value": 1}
          )
      )
      eval_config = config_pb2.EvalConfig(
          model_specs=[
              config_pb2.ModelSpec(),
          ],
          cross_slicing_specs=cross_slicing_specs,
          metrics_specs=[
              config_pb2.MetricsSpec(
                  metrics=[
                      config_pb2.MetricConfig(
                          class_name="WeightedExampleCount",
                          # 1.5 < 1, NOT OK.
                          threshold=(
                              threshold
                              if cross_slicing_specs is None
                              else None
                          ),
                          cross_slice_thresholds=[
                              config_pb2.CrossSliceMetricThreshold(
                                  cross_slicing_specs=cross_slicing_specs,
                                  threshold=threshold,
                              )
                          ],
                      ),
                  ],
                  model_names=[""],
                  example_weights=config_pb2.ExampleWeightOptions(
                      weighted=True
                  ),
              ),
          ],
      )
      sliced_metrics = (
          slice_key,
          {
              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)
  
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 20 for calling the MetricsValidatorTest obj's underlying member method code with example usage: obj.testValidateMetricsCrossSliceThresholdFail(cross_slicing_specs, slice_key) without return types