code: def load_point_estimates(
      trial_output_dir: str,
  ) -> Dict[metric_types.MetricKey, float]:
      """Loads the point estimates for each metric in a TFMA run."""
      population_values = {}
      path = os.path.join(trial_output_dir, "metrics")
      for rec in tf.compat.v1.io.tf_record_iterator(path):
          metrics_for_slice = (
              metrics_for_slice_pb2.MetricsForSlice.FromString(rec)
          )
          for kv in metrics_for_slice.metric_keys_and_values:
              if kv.value.WhichOneof("type") != "double_value":
                  continue
              population_values[
                  metric_types.MetricKey.from_proto(kv.key)
              ] = kv.value.double_value.value
      return population_values
  
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 4 for calling a global function with example usage: load_point_estimates(trial_output_dir) and returns: population_values