class_docstr: Extends HyperBand early stopping algorithm for BOHB.
  
  This implementation removes the ``HyperBandScheduler`` pipelining. This
  class introduces key changes:
  
  1. Trials are now placed so that the bracket with the largest size is
  filled first.
  
  2. Trials will be paused even if the bracket is not filled. This allows
  BOHB to insert new trials into the training.
  
  See ray.tune.schedulers.HyperBandScheduler for parameter docstring.
docstr: Fair scheduling within iteration by completion percentage.
  
  List of trials not used since all trials are tracked as state
  of scheduler. If iteration is occupied (ie, no trials to run),
  then look into next iteration.
code: def choose_trial_to_run(
      self,
      tune_controller: "TuneController",
      allow_recurse: bool = True,
  ) -> Optional[Trial]:
      """Fair scheduling within iteration by completion percentage.
  
      List of trials not used since all trials are tracked as state
      of scheduler. If iteration is occupied (ie, no trials to run),
      then look into next iteration.
      """
  
      for hyperband in self._hyperbands:
          # band will have None entries if no resources
          # are to be allocated to that bracket.
          scrubbed = [b for b in hyperband if b is not None]
          for bracket in scrubbed:
              for trial in bracket.current_trials():
                  if (
                      trial.status == Trial.PAUSED
                      and trial in bracket.trials_to_unpause
                  ) or trial.status == Trial.PENDING:
                      return trial
      # MAIN CHANGE HERE!
      if not any(
          t.status == Trial.RUNNING
          for t in tune_controller.get_trials()
      ):
          for hyperband in self._hyperbands:
              for bracket in hyperband:
                  if bracket and any(
                      trial.status == Trial.PAUSED
                      for trial in bracket.current_trials()
                  ):
                      # This will change the trial state
                      logger.debug(
                          "Processing bracket since no trial is running."
                      )
                      self._process_bracket(tune_controller, bracket)
  
                      # If there are pending trials now, suggest one.
                      # This is because there might be both PENDING and
                      # PAUSED trials now, and PAUSED trials will raise
                      # an error before the trial runner tries again.
                      if allow_recurse and any(
                          (
                              trial.status == Trial.PAUSED
                              and trial in bracket.trials_to_unpause
                          )
                          or trial.status == Trial.PENDING
                          for trial in bracket.current_trials()
                      ):
                          return self.choose_trial_to_run(
                              tune_controller, allow_recurse=False
                          )
      # MAIN CHANGE HERE!
      return None
  
file_path: ray/python/ray/tune/schedulers/hb_bohb.py
imports: import logging
  from typing import Dict, Optional, TYPE_CHECKING
  from ray.tune.schedulers.trial_scheduler import TrialScheduler
  from ray.tune.schedulers.hyperband import HyperBandScheduler
  from ray.tune.experiment import Trial
  from ray.util import PublicAPI
label_desc: Use image node_id 4 for calling the HyperBandForBOHB obj's underlying member method code with example usage: obj.choose_trial_to_run(tune_controller, allow_recurse) and returns: None, trial, self