code: def get_cmd_config(cmdargs) -> ExperimentConfig:
      """Fetch configuration defined by commandline and local configuration file.
  
      Arguments of commandline have priority over options in configuration file.
      """
      cmdargs = resolve_config.fetch_config_from_cmdargs(cmdargs)
  
      cmd_config = resolve_config.fetch_config(cmdargs)
      cmd_config = resolve_config.merge_configs(cmd_config, cmdargs)
  
      cmd_config.update(cmd_config.pop("experiment", {}))
      cmd_config["user_script_config"] = cmd_config.get(
          "worker", {}
      ).get("user_script_config", None)
  
      cmd_config["branching"] = cmd_config.pop("evc", {})
  
      # TODO: We should move branching specific stuff below in a centralized place for EVC stuff.
      if (
          cmd_config["branching"].get("auto_resolution", False)
          and cmdargs.get("manual_resolution", None) is None
      ):
          cmd_config["branching"]["manual_resolution"] = False
  
      non_monitored_arguments = cmdargs.get("non_monitored_arguments")
      if non_monitored_arguments:
          cmd_config["branching"][
              "non_monitored_arguments"
          ] = non_monitored_arguments.split(":")
  
      # TODO: user_args won't be defined if reading from DB only (`orion hunt -n <exp> ` alone)
      metadata = resolve_config.fetch_metadata(
          cmd_config.get("user"),
          cmd_config.get("user_args"),
          cmd_config.get("user_script_config"),
      )
      cmd_config["metadata"] = metadata
      cmd_config.pop("config", None)
  
      cmd_config["space"] = cmd_config["metadata"].get("priors", None)
  
      backward.update_db_config(cmd_config)
      return cmd_config
  
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 10 for calling a global function with example usage: get_cmd_config(cmdargs) and returns: cmd_config