code: def test_successive_halving_pruner_intermediate_values(
      direction_value: Tuple[str, float]
  ) -> None:
      direction, intermediate_value = direction_value
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource=1, reduction_factor=2, min_early_stopping_rate=0
      )
      study = optuna.study.create_study(
          direction=direction, pruner=pruner
      )
  
      trial = study.ask()
      trial.report(1, 1)
  
      # A pruner is not activated at a first trial.
      assert not trial.should_prune()
  
      trial = study.ask()
      # A pruner is not activated if a trial has no intermediate values.
      assert not trial.should_prune()
  
      trial.report(intermediate_value, 1)
      # A pruner is activated if a trial has an intermediate value.
      assert trial.should_prune()
  
file_path: optuna/tests/pruners_tests/test_successive_halving.py
imports: from typing import Tuple
  import pytest
  import optuna
label_desc: Use image node_id 1 for calling a global function with example usage: test_successive_halving_pruner_intermediate_values(direction_value) without return types