code: def test_hyperband_pruner_and_grid_sampler() -> None:
      pruner = optuna.pruners.HyperbandPruner(
          min_resource=MIN_RESOURCE,
          max_resource=MAX_RESOURCE,
          reduction_factor=REDUCTION_FACTOR,
      )
  
      search_space = {"x": [-50, 0, 50], "y": [-99, 0, 99]}
      sampler = optuna.samplers.GridSampler(search_space)
  
      study = optuna.study.create_study(sampler=sampler, pruner=pruner)
  
      def objective(trial: optuna.trial.Trial) -> float:
          for i in range(N_REPORTS):
              trial.report(i, step=i)
  
          x = trial.suggest_float("x", -100, 100)
          y = trial.suggest_int("y", -100, 100)
          return x**2 + y**2
  
      study.optimize(objective, n_trials=10)
  
      trials = study.trials
      assert len(trials) == 9
  
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 9 for calling a global function with example usage: test_hyperband_pruner_and_grid_sampler() and returns: unknown