code: def testMetricKeysToSkipForConfidenceIntervals(self):
      metrics_specs = [
          config_pb2.MetricsSpec(
              metrics=[
                  config_pb2.MetricConfig(
                      class_name="ExampleCount",
                      config=json.dumps({"name": "example_count"}),
                      threshold=config_pb2.MetricThreshold(
                          value_threshold=config_pb2.GenericValueThreshold()
                      ),
                  ),
                  config_pb2.MetricConfig(
                      class_name="MeanLabel",
                      config=json.dumps({"name": "mean_label"}),
                      threshold=config_pb2.MetricThreshold(
                          change_threshold=config_pb2.GenericChangeThreshold()
                      ),
                  ),
                  config_pb2.MetricConfig(
                      class_name="MeanSquaredError",
                      config=json.dumps({"name": "mse"}),
                      threshold=config_pb2.MetricThreshold(
                          change_threshold=config_pb2.GenericChangeThreshold()
                      ),
                  ),
              ],
              model_names=["model_name1", "model_name2"],
              output_names=["output_name1", "output_name2"],
          ),
      ]
      metrics_specs += metric_specs.specs_from_metrics(
          [tf.keras.metrics.MeanSquaredError("mse")],
          model_names=["model_name1", "model_name2"],
      )
      keys = metric_specs.metric_keys_to_skip_for_confidence_intervals(
          metrics_specs, eval_config=config_pb2.EvalConfig()
      )
      self.assertLen(keys, 8)
      self.assertIn(
          metric_types.MetricKey(
              name="example_count",
              model_name="model_name1",
              output_name="output_name1",
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="example_count",
              model_name="model_name1",
              output_name="output_name2",
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="example_count",
              model_name="model_name2",
              output_name="output_name1",
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="example_count",
              model_name="model_name2",
              output_name="output_name2",
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="example_count", model_name="model_name1"
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="weighted_example_count",
              model_name="model_name1",
              example_weighted=True,
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="example_count", model_name="model_name2"
          ),
          keys,
      )
      self.assertIn(
          metric_types.MetricKey(
              name="weighted_example_count",
              model_name="model_name2",
              example_weighted=True,
          ),
          keys,
      )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/metric_specs_test.py
imports: import json
  import tensorflow
  from tensorflow_model_analysis.metrics import calibration
  from tensorflow_model_analysis.metrics import confusion_matrix_metrics
  from tensorflow_model_analysis.metrics import mean_regression_error
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 2 for calling the MetricSpecsTest obj's underlying member method code with example usage: obj.testMetricKeysToSkipForConfidenceIntervals() without return types