code: def compute_coverage(
      output_dir: str,
  ) -> Dict[metric_types.MetricKey, float]:
      """Computes the per-metric CI coverage fraction."""
      trial_cis, population_values = load_cis(output_dir)
      coverage_counts = collections.defaultdict(int)
      for metric_name, cis in trial_cis.items():
          for lower, upper in cis:
              coverage_counts[metric_name] += int(
                  population_values[metric_name] >= lower
                  and population_values[metric_name] <= upper
              )
  
      coverage_rates = {
          k: count / len(trial_cis[k])
          for k, count in coverage_counts.items()
      }
      return coverage_rates
  
imports: import collections
  import os
  from typing import Callable, Dict, Iterable, Iterator, List, Sequence, Tuple
  from absl import app
  from absl import flags
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: compute_coverage(output_dir) and returns: coverage_rates