code: def on_trial_add(self, trial_runner, trial):
          
  
          cur_bracket = self._state["bracket"]
          cur_band = self._hyperbands[self._state["band_idx"]]
          if cur_bracket is None or cur_bracket.filled():
              retry = True
              while retry:
                  # if current iteration is filled, create new iteration
                  if self._cur_band_filled():
                      cur_band = []
                      self._hyperbands.append(cur_band)
                      self._state["band_idx"] += 1
  
                  # cur_band will always be less than s_max_1 or else filled
                  s = len(cur_band)
                  assert s < self._s_max_1, "Current band is filled!"
                  if self._get_r0(s) == 0:
                      logger.info("Bracket too small - Retrying...")
                      cur_bracket = None
                  else:
                      retry = False
                      cur_bracket = Bracket(self._time_attr, self._get_n0(s),
                                            self._get_r0(s), self._max_t_attr,
                                            self._eta, s)
                  cur_band.append(cur_bracket)
                  self._state["bracket"] = cur_bracket
  
          self._state["bracket"].add_trial(trial)
          self._trial_info[trial] = cur_bracket, self._state["band_idx"]
docs: Adds new trial.
  
          On a new trial add, if current bracket is not filled,
          add to current bracket. Else, if current band is not filled,
          create new bracket, add to current bracket.
          Else, create new iteration, create new bracket, add to bracket.