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"]
code: def _attempt_branching(
      self, conflicts, experiment, version, branching
  ):
      if len(conflicts.get()) > 1:
          log.debug("Experiment must branch because of conflicts")
      else:
          assert branching.get("branch_to")
          log.debug("Experiment branching forced with ``branch_to``")
  
      branched_experiment = self._branch_experiment(
          experiment, conflicts, version, branching
      )
      log.debug(
          "Now attempting registration of branched experiment in DB."
      )
      try:
          self._register_experiment(branched_experiment)
          log.debug(
              "Branched experiment successfully registered in DB."
          )
      except DuplicateKeyError as e:
          log.debug(
              "Experiment registration failed. This is likely due to a race condition "
              "during branching. Now rolling back and re-attempting building "
              "the branched experiment."
          )
          raise RaceCondition(
              "There was a race condition during branching. This error can "
              "also occur if you try branching from a specific version that already "
              "has a child experiment with the same name. Change the name of the new "
              "experiment and use `branch-from` to specify the parent experiment."
          ) from e
  
      return branched_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 8 for calling the ExperimentBuilder obj's underlying member method code with example usage: obj._attempt_branching(conflicts, experiment, version, branching) and returns: branched_experiment