code: def create_experiments(
      n_previous_experiments: int,
      n_trials_per_experiment: int,
      storage: BaseStorageProtocol,
      prefix: str = "source",
  ) -> list[ExperimentClient]:
      """Fixture that creates a set of experiments, and adds them to the given storage object."""
      # NOTE: The experiments are implicitly added to the Storage object, due to the storage being a
      # singleton.
      task = RosenBrock()
      source_experiments: list[ExperimentClient] = []
      assert len(storage.fetch_experiments({})) == 0
  
      for i in range(n_previous_experiments):
          source_experiment = build_experiment(
              name=f"{prefix}_{i}",
              space=task.get_search_space(),
              max_trials=n_trials_per_experiment,
              storage=storage,
          )
          source_experiment.workon(
              task, max_trials=n_trials_per_experiment
          )
          source_experiments.append(source_experiment)
      assert (
          len(storage.fetch_experiments({})) == n_previous_experiments
      )
      return source_experiments
  
file_path: orion/tests/unittests/core/worker/warm_start/test_knowledge_base.py
imports: from __future__ import annotations
  from pathlib import Path
  import pytest
  from orion.benchmark.task import RosenBrock
  from orion.client import build_experiment
  from orion.client.experiment import ExperimentClient
  from orion.core.io.database.pickleddb import PickledDB
  from orion.core.worker.experiment_config import ExperimentConfig
  from orion.core.worker.warm_start import KnowledgeBase
  from orion.storage.base import BaseStorageProtocol
  from orion.storage.legacy import Legacy
label_desc: Use image node_id 2 for calling a global function with example usage: create_experiments(n_previous_experiments, n_trials_per_experiment, storage, prefix) and returns: source_experiments