code: def test_save_and_load(
      make_scenario, configspace_small, make_config_selector
  ):
      """Tests whether entries from the runhistory are incorporated."""
      scenario: Scenario = make_scenario(
          configspace_small, use_instances=True, n_instances=3
      )
      runhistory = RunHistory()
      intensifier = Intensifier(
          scenario=scenario, max_config_calls=3, seed=0
      )
      intensifier.config_selector = make_config_selector(
          scenario, runhistory, n_initial_configs=1
      )
      intensifier.runhistory = runhistory
      gen = iter(intensifier)
  
      for i in range(50):
          trial = next(gen)
          cost = random.random()
          runhistory.add(
              config=trial.config,
              cost=cost,
              time=0.0,
              instance=trial.instance,
              seed=trial.seed,
              status=StatusType.SUCCESS,
              force_update=True,
          )
          intensifier.update_incumbents(trial.config)
  
      filename = "smac3_output_test/test_intensifier/intensifier.json"
      intensifier.save(filename)
  
      old_incumbents_changed = intensifier._incumbents_changed
      old_trajectory = intensifier._trajectory
      assert old_incumbents_changed > 0
  
      intensifier.load(filename)
  
      assert intensifier._incumbents_changed == old_incumbents_changed
      assert intensifier._trajectory == old_trajectory
  
file_path: SMAC3/tests/test_intensifier/test_abstract_intensifier.py
imports: import random
  import pytest
  from smac.initial_design.random_design import RandomInitialDesign
  from smac.intensifier.abstract_intensifier import AbstractIntensifier
  from smac.intensifier.intensifier import Intensifier
  from smac.main.config_selector import ConfigSelector
  from smac.runhistory.enumerations import StatusType
  from smac.runhistory.runhistory import RunHistory
  from smac.scenario import Scenario
label_desc: Use image node_id 5 for calling a global function with example usage: test_save_and_load(make_scenario, configspace_small, make_config_selector) without return types