parameters: (files_or_dir)
return_statement: return result
docstring: walk through file list or directory and parse according to file type (wtstats / wtperf).
docstring_summary: walk through file list or directory and parse according to file type (wtstats / wtperf).
docstring_tokens: walk through file list or directory and parse according to file type ( wtstats / wtperf ) .
function: def parse_files(files_or_dir):
      """ walk through file list or directory and parse according to file type (wtstats / wtperf). """
  
      result = defaultdict(list)
  
      for f in files_or_dir:
          if os.path.isfile(f):
              # peek at first line to determine type
              with open(f, 'rU') as fh:
                  line = fh.readline()
                  if line.startswith('#time'):
                      parse_wtperf_file(f, result)
                  else: 
                      parse_wtstats_file(f, result)
              
          elif os.path.isdir(f):
              for s in glob(os.path.join(f, 'WiredTigerStat*')):
                  parse_wtstats_file(s, result)
  
              for s in glob(os.path.join(f, 'monitor*')):
                  parse_wtperf_file(s, result)
  
      return result
function_tokens: def parse_files ( files_or_dir ) : result = defaultdict ( list ) for f in files_or_dir : if os . path . isfile ( f ) : # peek at first line to determine type with open ( f , 'rU' ) as fh : line = fh . readline ( ) if line . startswith ( '#time' ) : parse_wtperf_file ( f , result ) else : parse_wtstats_file ( f , result ) elif os . path . isdir ( f ) : for s in glob ( os . path . join ( f , 'WiredTigerStat*' ) ) : parse_wtstats_file ( s , result ) for s in glob ( os . path . join ( f , 'monitor*' ) ) : parse_wtperf_file ( s , result ) return result