code: def test_state(
      make_scenario, configspace_small, make_config_selector
  ):
      """Tests whether the tracker is saved and loaded correctly."""
      scenario: Scenario = make_scenario(
          configspace_small,
          use_instances=False,
          min_budget=1,
          max_budget=3,
      )
      runhistory = RunHistory()
      intensifier = SuccessiveHalving(scenario=scenario)
      intensifier.config_selector = make_config_selector(
          scenario, runhistory, n_initial_configs=1
      )
      intensifier.runhistory = runhistory
  
      gen = iter(intensifier)
  
      # Add some configs to the tracker
      for _ in range(10):
          trial = next(gen)
          runhistory.add_running_trial(
              trial
          )  # We have to mark it as running manually
          intensifier.update_incumbents(trial.config)
  
      # Save current state as old state
      old_state = intensifier.get_state()
      assert len(intensifier.get_state()["tracker"]) > 0
  
      # Now we reset the intensifier
      intensifier._tracker = {}
      assert len(intensifier.get_state()["tracker"]) == 0
  
      # Next, we set the state again
      intensifier.set_state(old_state)
      new_state = intensifier.get_state()
  
      assert old_state == new_state
  
file_path: SMAC3/tests/test_intensifier/test_successive_halving.py
imports: import pytest
  from smac.initial_design.random_design import RandomInitialDesign
  from smac.intensifier.successive_halving import SuccessiveHalving
  from smac.main.config_selector import ConfigSelector
  from smac.runhistory.dataclasses import InstanceSeedBudgetKey
  from smac.runhistory.enumerations import StatusType
  from smac.runhistory.runhistory import RunHistory
  from smac.scenario import Scenario
label_desc: Use image node_id 9 for calling a global function with example usage: test_state(make_scenario, configspace_small, make_config_selector) without return types