code: def test_successive_halving_pruner_min_resource_parameter() -> None:
      # min_resource=0: Error (must be `min_resource >= 1`).
      with pytest.raises(ValueError):
          optuna.pruners.SuccessiveHalvingPruner(
              min_resource=0,
              reduction_factor=2,
              min_early_stopping_rate=0,
          )
  
      # min_resource=1: The rung 0 ends at step 1.
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource=1, reduction_factor=2, min_early_stopping_rate=0
      )
      study = optuna.study.create_study(pruner=pruner)
      trial = study.ask()
  
      trial.report(1, step=1)
      assert not trial.should_prune()
      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
  
      # min_resource=2: The rung 0 ends at step 2.
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource=2, reduction_factor=2, min_early_stopping_rate=0
      )
      study = optuna.study.create_study(pruner=pruner)
      trial = study.ask()
  
      trial.report(1, step=1)
      assert not trial.should_prune()
      trial_system_attrs = trial.storage.get_trial_system_attrs(
          trial._trial_id
      )
      assert "completed_rung_0" not in trial_system_attrs
  
      trial.report(1, step=2)
      assert not trial.should_prune()
      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
  
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 7 for calling a global function with example usage: test_successive_halving_pruner_min_resource_parameter() without return types