(
        self, study: "optuna.study.Study", trial: "optuna.trial.FrozenTrial"
    )
Compute the index of bracket for a trial of ``trial_number``.

        The index of a bracket is noted as :math:`s` in
        `Hyperband paper <http://www.jmlr.org/papers/volume18/16-558/16-558.pdf>`_.
Compute the index of bracket for a trial of ``trial_number``.
Compute the index of bracket for a trial of trial_number .
def _get_bracket_id(
        self, study: "optuna.study.Study", trial: "optuna.trial.FrozenTrial"
    ) -> int:
        """Compute the index of bracket for a trial of ``trial_number``.

        The index of a bracket is noted as :math:`s` in
        `Hyperband paper <http://www.jmlr.org/papers/volume18/16-558/16-558.pdf>`_.
        """

        if len(self._pruners) == 0:
            return 0

        assert self._n_brackets is not None
        n = (
            hash("{}_{}".format(study.study_name, trial.number))
            % self._total_trial_allocation_budget
        )
        for bracket_id in range(self._n_brackets):
            n -= self._trial_allocation_budgets[bracket_id]
            if n < 0:
                return bracket_id

        assert False, "This line should be unreachable."
def _get_bracket_id ( self , study : "optuna.study.Study" , trial : "optuna.trial.FrozenTrial" ) -> int : if len ( self . _pruners ) == 0 : return 0 assert self . _n_brackets is not None n = ( hash ( "{}_{}" . format ( study . study_name , trial . number ) ) % self . _total_trial_allocation_budget ) for bracket_id in range ( self . _n_brackets ) : n -= self . _trial_allocation_budgets [ bracket_id ] if n < 0 : return bracket_id assert False , "This line should be unreachable."