code: def load_metrics(event_dir, epoch):
      """Loads metrics for this epoch if they have already been written.
  
      This reads the entire event file but it's small with just per-epoch metrics.
  
      Args:
        event_dir: TODO(koz4k): Document this.
        epoch: TODO(koz4k): Document this.
  
      Returns:
        metrics.
      """
      metrics = {}
      for filename in tf.gfile.ListDirectory(event_dir):
          path = os.path.join(event_dir, filename)
          for event in tf.train.summary_iterator(path):
              if event.step == epoch and event.HasField("summary"):
                  value = event.summary.value[0]
                  metrics[value.tag] = value.simple_value
      return metrics
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import datetime
  import math
  import os
  import pprint
  import random
  import time
  import six
  from tensor2tensor.bin import t2t_trainer
  from tensor2tensor.models.research import rl
  from tensor2tensor.rl import rl_utils
  from tensor2tensor.rl import trainer_model_based_params
  from tensor2tensor.rl.dopamine_connector import DQNLearner
  from tensor2tensor.rl.restarter import Restarter
  from tensor2tensor.utils import trainer_lib
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling a global function with example usage: load_metrics(event_dir, epoch) and returns: metrics