code: def test_warm_start_benchmarking(
      algo: type[BaseAlgorithm], tmp_path: Path
  ):
      """Integration test. Compares the performance in the three cases (cold, warm, hot)-starting.
  
      - Cold-start: Optimize the target task with no prior knowledge (lower bound);
      - Warm-start: Optimize the target task with some prior knowledge from "related" tasks;
      - Hot-start:  Optimize the target task with some prior knowledge from the *same* task (upper
                    bound).
      """
      algo_config = {"of_type": algo.__qualname__.lower(), "seed": 42}
  
      source_task = simple_quadratic(a=1, b=-2, c=1)
      target_task = simple_quadratic(a=1, b=-2, c=1)
  
      source_space: Space = _space({"x": "uniform(-5, 5)"})
      target_space: Space = _space({"x": "uniform(-5, 5)"})
  
      n_source_trials = 20  # Number of trials from the source task
      max_trials = 20  # Number of trials in the target task
  
      warm_start_storage = _temp_storage(tmp_path / "warm.pkl")
      # Populate the warm-start storage with some data from the source task.
      source_experiment = build_experiment(
          name="source",
          space=source_space,
          storage=warm_start_storage,
          max_trials=n_source_trials,
          algorithm={"of_type": "random", "seed": 42},
      )
      source_experiment.workon(_wrap(source_task))
      warm_start_kb = KnowledgeBase(warm_start_storage)
      assert warm_start_kb.n_stored_experiments == 1
  
      hot_start_storage = _temp_storage(tmp_path / "hot.pkl")
      # Populate the hot-start storage with some data from the *target* task.
      target_prior_experiment = build_experiment(
          name="target_prior",
          space=target_space,
          storage=hot_start_storage,
          max_trials=n_source_trials,
          algorithm={"of_type": "random", "seed": 42},
      )
      target_prior_experiment.workon(_wrap(target_task))
      hot_start_kb = KnowledgeBase(hot_start_storage)
  
      # Execute the three different experiments:
      # Cold start: No prior information.
      cold_start = workon(
          _wrap(target_task),
          name="cold_start",
          space=target_space,
          max_trials=max_trials,
          algorithm=algo_config,
          knowledge_base=None,
      )
      # Warm-start: Prior information from the source task.
      warm_start = workon(
          _wrap(target_task),
          name="warm_start",
          space=target_space,
          max_trials=max_trials,
          algorithm=algo_config,
          knowledge_base=warm_start_kb,
      )
      # Hot-start: Prior information from the target task.
      hot_start = workon(
          _wrap(target_task),
          name="hot_start",
          space=target_space,
          max_trials=max_trials,
          algorithm=algo_config,
          knowledge_base=hot_start_kb,
      )
  
      cold_objective = _get_best_trial_objective(cold_start)
      warm_objective = _get_best_trial_objective(warm_start)
      hot_objective = _get_best_trial_objective(hot_start)
      assert hot_objective <= warm_objective
      assert warm_objective <= cold_objective
  
imports: from __future__ import annotations
  import functools
  import random
  from pathlib import Path
  from typing import Callable
  import numpy
  import pytest
  from typing_extensions import ParamSpec
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Space
  from orion.algo.tpe import TPE
  from orion.client import build_experiment, workon
  from orion.client.experiment import ExperimentClient
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.trial import Trial
  from orion.core.worker.warm_start.knowledge_base import KnowledgeBase
  from orion.storage.base import BaseStorageProtocol, setup_storage
label_desc: Use image node_id 4 for calling a global function with example usage: test_warm_start_benchmarking(algo, tmp_path) without return types