def METHOD_NAME(line):
  """Convert metrics line to dict.
    Args:
        line: str 
    Returns:
        dict_of_lists: dict  where keys are metric names and vals 
        are lists of values.
            e.g. {'loss':[5.1, 3.2, 1.0],
                  'step':[100, 200, 300]}
    """
  eval_results = []
  dict_str = re.match(METRICS_LINE_REGEX, line).group(2)
  dict_str = dict_str.replace("'", "\"")
  dict_str = dict_str.replace("(", "")
  dict_str = dict_str.replace(")", "")
  dict_str = dict_str.replace("DeviceArray", "")
  dict_str = dict_str.replace(", dtype=float32", "")
  dict_str = dict_str.replace("nan", "0")
  metrics_dict = json.loads(dict_str)
  for item in metrics_dict['eval_results']:
    if isinstance(item, dict):
      eval_results.append(item)
  keys = eval_results[0].keys()
  dict_of_lists = {}
  for key in keys:
    dict_of_lists[key] = []
  for eval_results_dict in eval_results:
    for key in eval_results_dict.keys():
      val = eval_results_dict[key]
      dict_of_lists[key].append(val)
  return dict_of_lists