class_docstr: Utility to make new experiments using the same storage object.
  
  Parameters
  ----------
  storage: dict or BaseStorageProtocol, optional
      Storage object or storage configuration.
  debug: bool, optional.
      If True, force using EphemeralDB for the storage. Default: False
class_docstr_tok: ["Utility","to","make","new","experiments","using","the","same","storage","object",".","Parameters","--","--","--","--","--","storage",":","dict","or","BaseStorageProtocol",",","optional","Storage","object","or","storage","configuration",".","debug",":","bool",",","optional",".","If","True",",","force","using","EphemeralDB","for","the","storage",".","Default",":","False"]
docstr: Instantiate the experiment and its attribute objects
  
  All unspecified arguments will be replaced by system's defaults (orion.core.config.*).
  
  Parameters
  ----------
  name: str
      Name of the experiment.
  version: int
      Version of the experiment.
  mode: str
      The access rights of the experiment on the database.
      'r': read access only
      'w': can read and write to database
      'x': can read and write to database, algo is instantiated and can execute optimization
  space: dict or Space object
      Optimization space of the algorithm. If dict, should have the form
      `dict(name='<prior>(args)')`.
  algorithm: str or dict, optional
      Algorithm used for optimization.
  strategy: str or dict, optional
      Parallel strategy to use to parallelize the algorithm.
  max_trials: int, optional
      Maximum number or trials before the experiment is considered done.
  max_broken: int, optional
      Number of broken trials for the experiment to be considered broken.
  storage: dict, optional
      Configuration of the storage backend.
  knowledge_base: KnowledgeBase | dict, optional
      Knowledge base instance, or configuration of the knowledge base. Will be used to
      warm-start the HPO algorithm, if possible.
code: def create_experiment(
      self,
      name: str,
      version: int,
      mode: Mode,
      space: Space | dict[str, str],
      algorithm: str | dict | None = None,
      algorithms: str | dict | None = None,
      max_trials: int | None = None,
      max_broken: int | None = None,
      working_dir: str | None = None,
      metadata: dict | None = None,
      refers: dict | None = None,
      producer: dict | None = None,
      knowledge_base: KnowledgeBase | dict | None = None,
      user: str | None = None,
      _id: int | str | None = None,
      **kwargs,
  ) -> Experiment:
      """Instantiate the experiment and its attribute objects
  
      All unspecified arguments will be replaced by system's defaults (orion.core.config.*).
  
      Parameters
      ----------
      name: str
          Name of the experiment.
      version: int
          Version of the experiment.
      mode: str
          The access rights of the experiment on the database.
          'r': read access only
          'w': can read and write to database
          'x': can read and write to database, algo is instantiated and can execute optimization
      space: dict or Space object
          Optimization space of the algorithm. If dict, should have the form
          `dict(name='<prior>(args)')`.
      algorithm: str or dict, optional
          Algorithm used for optimization.
      strategy: str or dict, optional
          Parallel strategy to use to parallelize the algorithm.
      max_trials: int, optional
          Maximum number or trials before the experiment is considered done.
      max_broken: int, optional
          Number of broken trials for the experiment to be considered broken.
      storage: dict, optional
          Configuration of the storage backend.
      knowledge_base: KnowledgeBase | dict, optional
          Knowledge base instance, or configuration of the knowledge base. Will be used to
          warm-start the HPO algorithm, if possible.
  
      """
      T = TypeVar("T")
      V = TypeVar("V")
  
      def _default(v: T | None, default: V) -> T | V:
          return v if v is not None else default
  
      space = _instantiate_space(space)
      max_trials = _default(
          max_trials, orion.core.config.experiment.max_trials
      )
      if isinstance(knowledge_base, dict):
          knowledge_base = _instantiate_knowledge_base(knowledge_base)
  
      instantiated_algorithm = _instantiate_algo(
          space=space,
          max_trials=max_trials,
          config=algorithm,
          ignore_unavailable=mode != "x",
          knowledge_base=knowledge_base,
      )
      if algorithms is not None and algorithm is None:
          log.warning(
              "algorithms is deprecated and will be removed in v0.4.0. Use algorithm instead."
          )
          instantiated_algorithm = _instantiate_algo(
              space=space,
              max_trials=max_trials,
              config=algorithms,
              ignore_unavailable=mode != "x",
              knowledge_base=knowledge_base,
          )
  
      max_broken = _default(
          max_broken, orion.core.config.experiment.max_broken
      )
      working_dir = _default(
          working_dir, orion.core.config.experiment.working_dir
      )
      metadata = _default(
          metadata, {"user": _default(user, getpass.getuser())}
      )
      refers = _default(
          refers, dict(parent_id=None, root_id=None, adapter=[])
      )
      refers["adapter"] = _instantiate_adapters(refers.get("adapter", []))  # type: ignore
  
      _instantiate_strategy((producer or {}).get("strategy"))
  
      experiment = Experiment(
          storage=self.storage,
          name=name,
          version=version,
          mode=mode,
          space=space,
          _id=_id,
          max_trials=max_trials,
          algorithm=instantiated_algorithm,
          max_broken=max_broken,
          working_dir=working_dir,
          metadata=metadata,
          refers=refers,
          knowledge_base=knowledge_base,
      )
      if kwargs:
          # TODO: https://github.com/Epistimio/orion/issues/972
          log.debug(
              "create_experiment received some extra unused arguments: %s",
              kwargs,
          )
  
      return experiment
  
imports: from __future__ import annotations
  import copy
  import datetime
  import getpass
  import logging
  import pprint
  import sys
  import typing
  from typing import Any, TypeVar
  import orion.core
  from orion.algo.base import BaseAlgorithm, algo_factory
  from orion.algo.space import Space
  from orion.core.evc.adapters import BaseAdapter
  from orion.core.evc.conflicts import ExperimentNameConflict, detect_conflicts
  from orion.core.io import resolve_config
  from orion.core.io.config import ConfigurationError
  from orion.core.io.database import DuplicateKeyError
  from orion.core.io.experiment_branch_builder import ExperimentBranchBuilder
  from orion.core.io.interactive_commands.branching_prompt import BranchingPrompt
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.utils import backward
  from orion.core.utils.exceptions import BranchingEvent, NoConfigurationError, NoNameError, RaceCondition
  from orion.core.worker.experiment import Experiment, Mode
  from orion.core.worker.experiment_config import ExperimentConfig
  from orion.core.worker.primary_algo import create_algo
  from orion.core.worker.warm_start import KnowledgeBase
  from orion.storage.base import setup_storage
label_desc: Use image node_id 12 for calling the ExperimentBuilder obj's underlying member method code with example usage: obj.create_experiment(name, version, mode, space, algorithm, algorithms, max_trials, max_broken, working_dir, metadata, refers, producer, knowledge_base, user, _id) and returns: experiment, unknown