code: def test_successive_halving_pruner_with_auto_min_resource(
      n_reports: int, n_trials: int
  ) -> None:
      pruner = optuna.pruners.SuccessiveHalvingPruner(
          min_resource="auto"
      )
      study = optuna.study.create_study(
          sampler=optuna.samplers.RandomSampler(), pruner=pruner
      )
  
      assert pruner._min_resource is None
  
      def objective(trial: optuna.trial.Trial) -> float:
          for i in range(n_reports):
              trial.report(1.0 / (i + 1), i)
              if trial.should_prune():
                  raise optuna.TrialPruned()
          return 1.0
  
      study.optimize(objective, n_trials=n_trials)
      if n_reports > 0 and n_trials > 1:
          assert (
              pruner._min_resource is not None
              and pruner._min_resource > 0
          )
      else:
          assert pruner._min_resource is None
  
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 5 for calling a global function with example usage: test_successive_halving_pruner_with_auto_min_resource(n_reports, n_trials) and returns: int