code: def create_run(
      experiment,
      command_name,
      config_updates=None,
      named_configs=(),
      force=False,
      log_level=None,
  ):
      sorted_ingredients = gather_ingredients_topological(experiment)
      scaffolding = create_scaffolding(experiment, sorted_ingredients)
      # get all split non-empty prefixes sorted from deepest to shallowest
      prefixes = sorted(
          [s.split(".") for s in scaffolding if s != ""],
          reverse=True,
          key=lambda p: len(p),
      )
  
      # --------- configuration process -------------------
  
      # Phase 1: Config updates
      config_updates = config_updates or {}
      config_updates = convert_to_nested_dict(config_updates)
      root_logger, run_logger = initialize_logging(
          experiment, scaffolding, log_level
      )
      distribute_config_updates(prefixes, scaffolding, config_updates)
  
      # Phase 2: Named Configs
      for ncfg in named_configs:
          scaff, cfg_name = get_scaffolding_and_config_name(
              ncfg, scaffolding
          )
          scaff.gather_fallbacks()
          ncfg_updates = scaff.run_named_config(cfg_name)
          distribute_presets(
              scaff.path, prefixes, scaffolding, ncfg_updates
          )
          for ncfg_key, value in iterate_flattened(ncfg_updates):
              set_by_dotted_path(
                  config_updates,
                  join_paths(scaff.path, ncfg_key),
                  value,
              )
  
      distribute_config_updates(prefixes, scaffolding, config_updates)
  
      # Phase 3: Normal config scopes
      for scaffold in scaffolding.values():
          scaffold.gather_fallbacks()
          scaffold.set_up_config()
  
          # update global config
          config = get_configuration(scaffolding)
          # run config hooks
          config_hook_updates = scaffold.run_config_hooks(
              config, command_name, run_logger
          )
          recursive_update(scaffold.config, config_hook_updates)
  
      # Phase 4: finalize seeding
      for scaffold in reversed(list(scaffolding.values())):
          scaffold.set_up_seed()  # partially recursive
  
      config = get_configuration(scaffolding)
      config_modifications = get_config_modifications(scaffolding)
  
      # ----------------------------------------------------
  
      experiment_info = experiment.get_experiment_info()
      host_info = get_host_info(experiment.additional_host_info)
      main_function = get_command(scaffolding, command_name)
      pre_runs = [
          pr for ing in sorted_ingredients for pr in ing.pre_run_hooks
      ]
      post_runs = [
          pr for ing in sorted_ingredients for pr in ing.post_run_hooks
      ]
  
      run = Run(
          config,
          config_modifications,
          main_function,
          copy(experiment.observers),
          root_logger,
          run_logger,
          experiment_info,
          host_info,
          pre_runs,
          post_runs,
          experiment.captured_out_filter,
      )
  
      if hasattr(main_function, "unobserved"):
          run.unobserved = main_function.unobserved
  
      run.force = force
  
      for scaffold in scaffolding.values():
          scaffold.finalize_initialization(run=run)
  
      return run
  
imports: import os
  from collections import OrderedDict, defaultdict
  from copy import copy, deepcopy
  from sacred.config import ConfigDict, chain_evaluate_config_scopes, dogmatize, load_config_file, undogmatize
  from sacred.config.config_summary import ConfigSummary
  from sacred.config.custom_containers import make_read_only
  from sacred.host_info import get_host_info
  from sacred.randomness import create_rnd, get_seed
  from sacred.run import Run
  from sacred.utils import convert_to_nested_dict, create_basic_stream_logger, get_by_dotted_path, is_prefix, rel_path, iterate_flattened, set_by_dotted_path, recursive_update, iter_prefixes, join_paths, NamedConfigNotFoundError, ConfigAddedError
  from sacred.settings import SETTINGS
label_desc: Use image node_id 12 for calling a global function with example usage: create_run(experiment, command_name, config_updates, named_configs, force, log_level) and returns: run