code: def test_successive_halving_pruner_with_nan() -> None:
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource=2, reduction_factor=2, min_early_stopping_rate=0
      )
      study = optuna.study.create_study(pruner=pruner)
      trial = optuna.trial.Trial(
          study, study._storage.create_new_trial(study._study_id)
      )
  
      # A pruner is not activated if the step is not a rung completion point.
      trial.report(float("nan"), step=1)
      assert not trial.should_prune()
  
      # A pruner is activated if the step is a rung completion point and
      # the intermediate value is NaN.
      trial.report(float("nan"), step=2)
      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 4 for calling a global function with example usage: test_successive_halving_pruner_with_nan() without return types