code: def test_hyperband_pruner_intermediate_values() -> 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
      )
  
      def objective(trial: optuna.trial.Trial) -> float:
          for i in range(N_REPORTS):
              trial.report(i, step=i)
  
          return 1.0
  
      study.optimize(
          objective, n_trials=N_BRACKETS * EXPECTED_N_TRIALS_PER_BRACKET
      )
  
      trials = study.trials
      assert len(trials) == N_BRACKETS * EXPECTED_N_TRIALS_PER_BRACKET
  
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 1 for calling a global function with example usage: test_hyperband_pruner_intermediate_values() and returns: int