code: def test_continue_different_scenario(rosenbrock, monkeypatch, facade):
      """Tests whether we can continue a run with a different scenario but using the same name."""
      # Overwrite completely
      number_inputs = StringIO("1\n")
      monkeypatch.setattr("sys.stdin", number_inputs)
      scenario = Scenario(
          rosenbrock.configspace,
          name="blub1",
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train, overwrite=True)
      smac.optimize()
  
      scenario = Scenario(
          rosenbrock.configspace,
          name="blub1",
          n_trials=11,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train)
  
      # Keep old run
      try:
          shutil.rmtree("smac3_output/blub2")
          shutil.rmtree("smac3_output/blub2-old")
      except FileNotFoundError:
          pass
  
      number_inputs = StringIO("2\n")
      monkeypatch.setattr("sys.stdin", number_inputs)
      scenario = Scenario(
          rosenbrock.configspace,
          name="blub2",
          n_trials=10,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train, overwrite=True)
      smac.optimize()
      scenario = Scenario(
          rosenbrock.configspace,
          name="blub2",
          n_trials=11,
          min_budget=1,
          max_budget=10,
      )
      smac = facade(scenario, rosenbrock.train)
      assert os.path.isdir("smac3_output/blub2-old")
  
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 2 for calling a global function with example usage: test_continue_different_scenario(rosenbrock, monkeypatch, facade) without return types