def stats_over_time(self,
                      session,
                      run,
                      extract_fn,
                      combine_fn,
                      no_data = None):
    """
    return reduce(combine_fn, map(extract_fn, data)) for each quanta of the
    tuning run
    """
    value_by_quanta = [ no_data ]
    start_date = run.start_date

    subq = (session.query(Result.id)
           .filter_by(tuning_run = run, was_new_best = True, state='OK'))

    q = (session.query(DesiredResult)
         .join(Result)
         .filter(DesiredResult.state=='COMPLETE',
                 DesiredResult.tuning_run == run,
                 DesiredResult.result_id.in_(subq.subquery()))
         .order_by(DesiredResult.request_date))

    first_id = None
    for dr in q:
      if first_id is None:
        first_id = dr.id
      td = (dr.request_date - start_date)
      duration = td.seconds + (td.days * 24 * 3600.0)
      if self.args.by_request_count:
        quanta = dr.id - first_id
      else:
        quanta = int(self.args.stats_quanta / duration)
      while len(value_by_quanta) <= quanta:
        value_by_quanta.append(value_by_quanta[-1])

      if value_by_quanta[-1] is no_data:
        value_by_quanta[-1] = extract_fn(dr)
      else:
        value_by_quanta[-1] = combine_fn(value_by_quanta[-1], extract_fn(dr))

    return value_by_quanta
dataset/ETHPy150Open jansel/opentuner/opentuner/utils/stats.py/StatsMain.stats_over_time/swapped operands of `/`