def get_values(labels):
  dbs = get_dbs(os.getcwd())
  dir_label_runs = defaultdict(lambda: defaultdict(list))
  for db in dbs:
    q = (db.query(resultsdb.models.TuningRun)
            .filter_by(state='COMPLETE')
            .order_by('name'))
    if labels:
      q = q.filter(resultsdb.models.TuningRun.name.in_(labels))
    for tr in q:
      dir_label_runs[run_label(tr)][run_label(tr)].append((tr, db))
  all_run_ids = list()
  returned_values = {}
  for d, label_runs in dir_label_runs.iteritems():
    all_run_ids = map(_[0].id, itertools.chain(*label_runs.values()))
    session = label_runs.values()[0][0][1]
    objective = label_runs.values()[0][0][0].objective

    q = (session.query(resultsdb.models.Result)
         .filter(resultsdb.models.Result.tuning_run_id.in_(all_run_ids))
         .filter(resultsdb.models.Result.time < float('inf'))
         .filter_by(was_new_best=True, state='OK'))
    total = q.count()
    q = objective.filter_acceptable(q)
    acceptable = q.count()
    q = q.order_by(*objective.result_order_by_terms())
    best = q.limit(1).one()
    worst = q.offset(acceptable - 1).limit(1).one()

    for label, runs in sorted(label_runs.items()):
      (mean_values, percentile_values) = combined_stats_over_time(label, runs, objective, worst, best)
      returned_values[label] = (mean_values, percentile_values)
      final_scores = list()
      for run, session in runs:
        try:
          final = (session.query(resultsdb.models.Result)
                  .filter_by(tuning_run = run,
                             configuration = run.final_config)
                  .limit(1).one())
        except sqlalchemy.orm.exc.NoResultFound:
          continue
        final_scores.append(objective.stats_quality_score(final, worst, best))
      final_scores.sort()
  return returned_values
Restore the new state of the user interface and dependency graph.
dataset/ETHPy150Open jansel/opentuner/opentuner/utils/stats_matplotlib.py/get_values--crossover with--dataset/ETHPy150Open andrew-gardner/dependsworkflow/depends/depends_undo_commands.py/DagAndSceneUndoCommand.redo