code: def clean_config(name: str, config: dict, branching: dict | None):
      """Clean configuration from hidden fields (ex: ``_id``) and update branching if necessary"""
      log.debug("Cleaning config")
  
      config = copy.deepcopy(config)
      for key, value in list(config.items()):
          if key.startswith("_") or value is None:
              log.debug(f"Ignoring field {key}")
              config.pop(key)
  
      # TODO: Remove for v0.4
      if "strategy" in config:
          config["producer"] = {"strategy": config.pop("strategy")}
  
      if branching is None:
          branching = {}
  
      if branching.get("branch_from"):
          branching.setdefault("branch_to", name)
          name = branching["branch_from"]
  
      log.debug("Cleaned experiment config")
      log.debug("    Experiment config:\n%s", pprint.pformat(config))
      log.debug("    Branching config:\n%s", pprint.pformat(branching))
  
      return name, config, branching
  
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 1 for calling a global function with example usage: clean_config(name, config, branching) and returns: name,  config,  branching