code: def create_metric_keys(
      thresholds: Sequence[float],
      metrics: List[str],
      metric_name: str,
      model_name: str,
      output_name: str,
      example_weighted: bool,
  ) -> Tuple[
      List[metric_types.MetricKey],
      Dict[float, Dict[str, metric_types.MetricKey]],
  ]:
      """Creates metric keys map keyed at threshold and metric name."""
      keys = []
      metric_key_by_name_by_threshold = collections.defaultdict(dict)
      num_digits = _calculate_digits(thresholds)
      for threshold in thresholds:
          for metric in metrics:
              key = metric_types.MetricKey(
                  name="%s/%s@%.*f"
                  % (metric_name, metric, num_digits, threshold),
                  model_name=model_name,
                  output_name=output_name,
                  example_weighted=example_weighted,
              )
              keys.append(key)
              metric_key_by_name_by_threshold[threshold][metric] = key
      return keys, metric_key_by_name_by_threshold
  
file_path: model-analysis/tensorflow_model_analysis/addons/fairness/metrics/counterfactual_fairness/flip_count.py
imports: import collections
  from typing import Any, Dict, List, Optional, Iterator, Sequence, Tuple
  import numpy
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 2 for calling a global function with example usage: create_metric_keys(thresholds, metrics, metric_name, model_name, output_name, example_weighted) and returns: keys,  metric_key_by_name_by_threshold