code: def test_with_evc(algorithm, storage):
      """Test a scenario where algos are warm-started with EVC."""
  
      base_exp = build_experiment(
          name="exp",
          space=space_with_fidelity,
          algorithm=algorithm_configs["random"],
          max_trials=10,
          storage=storage,
      )
      base_exp.workon(rosenbrock, max_trials=10)
  
      exp = build_experiment(
          name="exp",
          space=space_with_fidelity,
          algorithm=algorithm,
          max_trials=30,
          storage=storage,
          branching={"branch_from": "exp", "enable": True},
      )
  
      assert exp.version == 2
  
      exp.workon(rosenbrock, max_trials=30)
  
      assert exp.configuration["algorithm"] == algorithm
  
      trials = exp.fetch_trials(with_evc_tree=False)
  
      # Some algo may not be able to suggest exactly 30 trials (ex: hyperband)
      assert len(trials) >= 20
  
      trials_with_evc = exp.fetch_trials(with_evc_tree=True)
      assert len(trials_with_evc) >= 30 or exp.algorithm.is_done
      assert len(trials_with_evc) - len(trials) == 10
  
      completed_trials = [
          trial
          for trial in trials_with_evc
          if trial.status == "completed"
      ]
      assert len(completed_trials) == 30
  
      results = [trial.objective.value for trial in completed_trials]
      assert all(
          trial.objective is not None for trial in completed_trials
      )
      best_trial = min(
          completed_trials, key=lambda trial: trial.objective.value
      )
  
      assert best_trial.objective.name == "objective"
      assert abs(best_trial.objective.value - 23.4) < 1e-5
      assert len(best_trial.params) == 2
      fidelity = best_trial._params[0]
      assert fidelity.name == "noise"
      assert fidelity.type == "fidelity"
      assert fidelity.value == 10
      param = best_trial._params[1]
      assert param.name == "x"
      assert param.type == "real"
  
imports: from __future__ import annotations
  import copy
  import os
  from pathlib import Path
  import numpy
  import pytest
  from orion.algo.pbt.pb2_utils import import_optional
  from orion.client import build_experiment, create_experiment, workon
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.utils.module_import import ImportOptional
  from orion.core.worker.algo_wrappers import AlgoWrapper
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.core.worker.trial import Trial
  from orion.storage.base import BaseStorageProtocol
  from orion.benchmark.task.base import BenchmarkTask
label_desc: Use image node_id 12 for calling a global function with example usage: test_with_evc(algorithm, storage) without return types