def METHOD_NAME(logfile):
  """Get a dict of dicts with metrics for each 
    tuning run.
    Returns:
        trials_dict: Dict of dicts where outer dict keys
            are trial indices and inner dict key-value pairs
            are metrics and list of values.
            e.g. {'trial_0': {'loss':[5.1, 3.2, 1.0],
                            'step':[100, 200, 300]},
                  'trial_1': {'loss':[5.1, 3.2, 1.0],
                            'step':[100, 200, 300]}}
    """
  trial = 0
  metrics_lines = {}
  with open(logfile, 'r') as f:
    for line in f:
      if re.match(TRIAL_LINE_REGEX, line):
        trial = re.match(TRIAL_LINE_REGEX, line).group(2)
      if re.match(METRICS_LINE_REGEX, line):
        metrics_lines[trial] = decode_metrics_line(line)
  if len(metrics_lines) == 0:
    raise ValueError(f'Log file does not have a metrics line {logfile}')
  return metrics_lines