code: def check_all_logs(directory, time_thresh):
      
      log_files = glob.glob(directory + '/*/0/000000000_00000000')
      print('I have ' + str(len(log_files)) + ' log files to scan')
      total_phase_errs = []
      for i, log_file in enumerate(log_files):
          startdate = dt.datetime.strptime(log_file.split('/')[-4][0:7],
                                           '%Y%j').date()
          total_phase_errs += rt_time_log(log_file, startdate)
          sys.stdout.write("\r" + str(float(i) / len(log_files) * 100) +
                           "% \r")
          sys.stdout.flush()
      time_errs = flag_time_err(total_phase_errs, time_thresh)
      time_errs.sort()
      return time_errs, total_phase_errs
docs: Check all the log-files in a directory tree for timing errors.
  
      :type directory: str
      :param directory: Directory to search within
      :type time_thresh: float
      :param time_thresh: Time threshold in seconds
  
      :returns: List of :class:`datetime.datetime` for which error timing is
          above threshold, e.g. times when data are questionable.
      :rtype: list