code: def collect_results_for(db="deep1M", prefix="autotune."):
      # run parsing
      allres = {}
      allstats = {}
      missing = []
  
      fnames = keep_latest_stdout(os.listdir(logdir))
      # print fnames
      # filenames are in the form <key>.x.stdout
      # where x is a version number (from a to z)
      # keep only latest version of each name
  
      for fname in fnames:
          if not (
              "db" + db in fname
              and fname.startswith(prefix)
              and fname.endswith(".stdout")
          ):
              continue
          print("parse", fname, end="   ", flush=True)
          try:
              indexkey, res, _, stats = parse_result_file(
                  logdir + fname
              )
          except RuntimeError as e:
              print("FAIL %s" % e)
              res = np.zeros((2, 0))
          except Exception as e:
              print("PARSE ERROR " + e)
              res = np.zeros((2, 0))
          else:
              print(len(res), "results")
          if res.size == 0:
              missing.append(fname)
          else:
              if indexkey in allres:
                  if (
                      allstats[indexkey]["run_version"]
                      > stats["run_version"]
                  ):
                      # don't use this run
                      continue
  
              allres[indexkey] = res
              allstats[indexkey] = stats
  
      return allres, allstats
  
file_path: faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py
imports: import os
  import numpy
  from collections import defaultdict
  from matplotlib import pyplot
  import re
  from argparse import Namespace
  from faiss.contrib.factory_tools import get_code_size
label_desc: Use image node_id 4 for calling a global function with example usage: collect_results_for(db, prefix) and returns: allres,  allstats