code: def get_train_times(exp_dir):
      train_log_files = "%s/log/" % (exp_dir)
      train_log_names = "train.*.log"
      train_log_lines = common_lib.get_command_stdout(
          'find {0} -name "{1}" | xargs grep -H -e Accounting'.format(
              train_log_files, train_log_names
          )
      )
      parse_regex = re.compile(
          ".*train\.([0-9]+)\.([0-9]+)\.log:# "
          "Accounting: time=([0-9]+) thread.*"
      )
  
      train_times = {}
      for line in train_log_lines.split("\n"):
          mat_obj = parse_regex.search(line)
          if mat_obj is not None:
              groups = mat_obj.groups()
              try:
                  train_times[int(groups[0])][int(groups[1])] = float(
                      groups[2]
                  )
              except KeyError:
                  train_times[int(groups[0])] = {}
                  train_times[int(groups[0])][int(groups[1])] = float(
                      groups[2]
                  )
      iters = train_times.keys()
      for iter in iters:
          values = train_times[iter].values()
          train_times[iter] = max(values)
      return train_times
  
imports: from __future__ import division
  from __future__ import print_function
  import traceback
  import datetime
  import logging
  import re
  import libs.common
label_desc: Use image node_id 6 for calling a global function with example usage: get_train_times(exp_dir) and returns: train_times