def technique_cmp(self, a, b):
  # a1 = self.old_best_results[a]
  # a2 = self.best_results[a]
  # b1 = self.old_best_results[b]
  # b2 = self.best_results[b]
  # if a1 is None and b1 is None:
  #   return 0
  # if a1 is None:
  #   return -1
  # if b1 is None:
  #   return 1
  # return self.driver.objective.project_compare(a1, a2, b1, b2, self.factor)

    # not ready techniques go to the back
    if not a.is_ready() or not b.is_ready():
      return cmp(b.is_ready(), a.is_ready())

    a = self.best_results[a]
    b = self.best_results[b]
    if a is None and b is None:
      return 0
    if a is None:
      return -1
    if b is None:
      return 1
    return self.driver.objective.compare(a, b)

  def recycle_techniques(self):
    techniques = list(self.techniques)
    techniques.sort(cmp=self.technique_cmp)
    worst = techniques[-1]

    if (not worst.is_ready()
        or (self.old_best_results[worst] is not None
            and self.driver.objective.lt(self.driver.best_result,
                                         self.best_results[worst]))):
      techniques_new = deque()
      tn = None
      for t, gen in zip(self.techniques, self.technique_generators):
        if t is worst:
          tn = gen(seed_cfg=self.driver.best_result.configuration.data)
          self.rename_technique(tn)
          tn.set_driver(self.driver)
          log.info("%s replacing %s with %s", self.name, t.name, tn.name)
          techniques_new.append(tn)
        else:
          techniques_new.append(t)
      self.techniques = techniques_new
    else:
      log.debug("%s: not replacing techniques", self.name)

    self.old_best_results = self.best_results
    self.best_results = defaultdict(lambda: None)
    for t in self.techniques:
      self.best_results[t] = self.old_best_results[t]

  def select_technique_order(self):
    """
    round robin between techniques
    """
    if self.request_count < self.last_check + self.window:
      self.last_check = self.request_count
      self.recycle_techniques()
    rv = list(self.techniques)
    self.techniques.rotate(1)
    self.technique_generators.rotate(1)
    return rv
dataset/ETHPy150Open jansel/opentuner/opentuner/search/metatechniques.py/RecyclingMetaTechnique.technique_cmp/swapped operands of `<`