code: def test_successive_halving_pruner_rung_check() -> None:
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource=1, reduction_factor=2, min_early_stopping_rate=0
      )
      study = optuna.study.create_study(pruner=pruner)
  
      # Report 7 trials in advance.
      for i in range(7):
          trial = study.ask()
          trial.report(0.1 * (i + 1), step=7)
          pruner.prune(
              study=study,
              trial=study._storage.get_trial(trial._trial_id),
          )
  
      # Report a trial that has the 7-th value from bottom.
      trial = study.ask()
      trial.report(0.75, step=7)
      pruner.prune(
          study=study, trial=study._storage.get_trial(trial._trial_id)
      )
  
      trial_system_attrs = trial.storage.get_trial_system_attrs(
          trial._trial_id
      )
      assert "completed_rung_0" in trial_system_attrs
      assert "completed_rung_1" not in trial_system_attrs
  
      # Report a trial that has the third value from bottom.
      trial = study.ask()
      trial.report(0.25, step=7)
      trial.should_prune()
      trial_system_attrs = trial.storage.get_trial_system_attrs(
          trial._trial_id
      )
      assert "completed_rung_1" in trial_system_attrs
      assert "completed_rung_2" not in trial_system_attrs
  
      # Report a trial that has the lowest value.
      trial = study.ask()
      trial.report(0.05, step=7)
      trial.should_prune()
      trial_system_attrs = trial.storage.get_trial_system_attrs(
          trial._trial_id
      )
      assert "completed_rung_2" in trial_system_attrs
      assert "completed_rung_3" not in trial_system_attrs
  
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 2 for calling a global function with example usage: test_successive_halving_pruner_rung_check() without return types