code: def test_bracket_study() -> None:
      pruner = optuna.pruners.HyperbandPruner(
          min_resource=MIN_RESOURCE,
          max_resource=MAX_RESOURCE,
          reduction_factor=REDUCTION_FACTOR,
      )
      study = optuna.study.create_study(
          sampler=optuna.samplers.RandomSampler(), pruner=pruner
      )
      bracket_study = pruner._create_bracket_study(study, 0)
  
      with pytest.raises(AttributeError):
          bracket_study.optimize(lambda *args: 1.0)
  
      with pytest.raises(AttributeError):
          bracket_study.set_user_attr("abc", 100)
  
      for attr in ("user_attrs", "system_attrs"):
          with pytest.raises(AttributeError):
              getattr(bracket_study, attr)
  
      with pytest.raises(AttributeError):
          bracket_study.trials_dataframe()
  
      bracket_study.get_trials()
      bracket_study.direction
      bracket_study._storage
      bracket_study._study_id
      bracket_study.pruner
      bracket_study.study_name
      # As `_BracketStudy` is defined inside `HyperbandPruner`,
      # we cannot do `assert isinstance(bracket_study, _BracketStudy)`.
      # This is why the below line is ignored by mypy checks.
      bracket_study._bracket_id
  
file_path: optuna/tests/pruners_tests/test_hyperband.py
imports: from typing import Callable
  from unittest import mock
  import numpy
  import pytest
  import optuna
label_desc: Use image node_id 2 for calling a global function with example usage: test_bracket_study() without return types