class_docstr: A bracket in BOHB, all the information of a bracket is managed by
  an instance of this class.
  
  Parameters
  ----------
  s: int
      The current Successive Halving iteration index.
  s_max: int
      total number of Successive Halving iterations
  eta: float
      In each iteration, a complete run of sequential halving is executed. In it,
              after evaluating each configuration on the same subset size, only a fraction of
              1/eta of them 'advances' to the next round.
      max_budget : float
              The largest budget to consider. Needs to be larger than min_budget!
              The budgets will be geometrically distributed
      :math:`a^2 + b^2 = c^2 \sim \eta^k` for :math:`k\in [0, 1, ... , num\_subsets - 1]`.
  optimize_mode: str
      optimize mode, 'maximize' or 'minimize'
class_docstr_tok: ["A","bracket","in","BOHB",",","all","the","information","of","a","bracket","is","managed","by","an","instance","of","this","class",".","Parameters","--","--","--","--","--","s",":","int","The","current","Successive","Halving","iteration","index",".","s_max",":","int","total","number","of","Successive","Halving","iterations","eta",":","float","In","each","iteration",",","a","complete","run","of","sequential","halving","is","executed",".","In","it",",","after","evaluating","each","configuration","on","the","same","subset","size",",","only","a","fraction","of","1\/eta","of","them","'advances","'","to","the","next","round",".","max_budget",":","float","The","largest","budget","to","consider",".","Needs","to","be","larger","than","min_budget","!","The","budgets","will","be","geometrically","distributed",":","math",":","`","a^2","+","b^2","=","c^2","\\sim","\\eta^k","`","for",":","math",":","`","k\\in","[","0",",","1",",","...",",","num\\_subsets","-","1","]","`",".","optimize_mode",":","str","optimize","mode",",","'maximize","'","or","'minimize","'"]
code: def __init__(self, s, s_max, eta, max_budget, optimize_mode):
      self.s = s
      self.s_max = s_max
      self.eta = eta
      self.max_budget = max_budget
      self.optimize_mode = OptimizeMode(optimize_mode)
  
      self.n = math.ceil((s_max + 1) * eta**s / (s + 1) - _epsilon)
      self.r = max_budget / eta**s
      self.i = 0
      self.hyper_configs = []  # [ {id: params}, {}, ... ]
      self.configs_perf = []  # [ {id: [seq, acc]}, {}, ... ]
      self.num_configs_to_run = []  # [ n, n, n, ... ]
      self.num_finished_configs = []  # [ n, n, n, ... ]
      self.no_more_trial = False
  
imports: import sys
  import math
  import logging
  from schema import Schema, Optional
  import ConfigSpace
  import ConfigSpace.hyperparameters
  from ConfigSpace.read_and_write import pcs_new
  import nni
  from nni import ClassArgsValidator
  from nni.runtime.tuner_command_channel import CommandType
  from nni.runtime.msg_dispatcher_base import MsgDispatcherBase
  from nni.utils import OptimizeMode, MetricType, extract_scalar_reward
  from nni.runtime.common import multi_phase_enabled
  from .config_generator import CG_BOHB
label_desc: Use image node_id 1 to create a new Bracket object  with example: obj = Bracket(s, s_max, eta, max_budget, optimize_mode)