code: def get_command(scaffolding, command_path):
      path, _, command_name = command_path.rpartition(".")
      if path not in scaffolding:
          raise KeyError(
              'Ingredient for command "%s" not found.' % command_path
          )
  
      if command_name in scaffolding[path].commands:
          return scaffolding[path].commands[command_name]
      else:
          if path:
              raise KeyError(
                  'Command "%s" not found in ingredient "%s"'
                  % (command_name, path)
              )
          else:
              raise KeyError('Command "%s" not found' % command_name)
  
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 7 for calling a global function with example usage: get_command(scaffolding, command_path) and returns: scaffolding