code: def test_25_percentile_pruner_intermediate_values_nan() -> None:
      pruner = optuna.pruners.PercentilePruner(25.0, 0, 0)
      study = optuna.study.create_study(pruner=pruner)
  
      trial = study.ask()
      trial.report(float("nan"), 1)
      # A pruner is not activated if the study does not have any previous trials.
      assert not trial.should_prune()
      study.tell(trial, -1)
  
      trial = study.ask()
      trial.report(float("nan"), 1)
      # A pruner is activated if the best intermediate value of this trial is NaN.
      assert trial.should_prune()
      study.tell(trial, -1)
  
      trial = study.ask()
      trial.report(1, 1)
      # A pruner is not activated if the 25 percentile intermediate value is NaN.
      assert not trial.should_prune()
  
file_path: optuna/tests/pruners_tests/test_percentile.py
imports: import math
  from typing import List
  from typing import Tuple
  import warnings
  import pytest
  import optuna
  from optuna.pruners import _percentile
  from optuna.study import Study
  from optuna.study import StudyDirection
  from optuna.trial import TrialState
label_desc: Use image node_id 7 for calling a global function with example usage: test_25_percentile_pruner_intermediate_values_nan() without return types