code: def test_hyperband_no_filter_study(
      pruner_init_func: Callable[[], optuna.pruners.BasePruner]
  ) -> None:
      def objective(trial: optuna.trial.Trial) -> float:
          return trial.suggest_float("value", 0.0, 1.0)
  
      n_trials = 10
      for method_name in [
          "infer_relative_search_space",
          "sample_relative",
          "sample_independent",
      ]:
          sampler = optuna.samplers.RandomSampler()
          pruner = pruner_init_func()
          with mock.patch(
              "optuna.samplers.{}.{}".format(
                  sampler.__class__.__name__, method_name
              ),
              wraps=getattr(sampler, method_name),
          ) as method_mock:
              study = optuna.study.create_study(
                  sampler=sampler, pruner=pruner
              )
              study.optimize(objective, n_trials=n_trials)
              args = method_mock.call_args[0]
              study = args[0]
              trials = study.get_trials()
              assert len(trials) == n_trials
  
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 6 for calling a global function with example usage: test_hyperband_no_filter_study(pruner_init_func) and returns: trial