code: def read_metrics_file(fname):
      metrics = defaultdict(list)
      for line in open(fname, encoding="utf-8"):
          entries = line.split()
          metrics["checkpoint"].append(int(entries[0]))
          for entry in entries[1:]:
              k, v = entry.split("=")
              v = PARSE_ENTRY[k](v)
              metrics[k].append(v)
      return metrics
  
file_path: sockeye/sockeye_contrib/plot_metrics.py
imports: from argparse import ArgumentParser
  from bisect import insort
  from collections import defaultdict
  from os import path
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: read_metrics_file(fname) and returns: metrics