code: def test_continue_same_scenario(rosenbrock, facade):
      # We did not optimize in the first run
      scenario = Scenario(
          rosenbrock.configspace,
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train, overwrite=True)
  
      scenario = Scenario(
          rosenbrock.configspace,
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train)
      smac.optimize()
  
      ##############
  
      scenario = Scenario(
          rosenbrock.configspace,
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train, overwrite=True)
      incumbent1 = smac.optimize()
  
      scenario = Scenario(
          rosenbrock.configspace,
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac2 = facade(scenario, rosenbrock.train)
      incumbent2 = smac2.optimize()
  
      # We expect that the old state is just reloaded
      # Since in the first optimization, we already finished, we should have the same incumbent
      assert incumbent1 == incumbent2
  
file_path: SMAC3/tests/test_continue.py
imports: from __future__ import annotations
  import os
  import shutil
  from io import StringIO
  import pytest
  from smac import AlgorithmConfigurationFacade
  from smac import BlackBoxFacade
  from smac import HyperbandFacade
  from smac import HyperparameterOptimizationFacade
  from smac import MultiFidelityFacade
  from smac import RandomFacade
  from smac import Scenario
  from smac.callback.callback import Callback
  from smac.runhistory.dataclasses import TrialInfo, TrialValue
label_desc: Use image node_id 1 for calling a global function with example usage: test_continue_same_scenario(rosenbrock, facade) without return types