code: def _make_local_execution_exp_config(
      input_config: Optional[Dict[str, Any]],
      checkpoint_dir: str,
      managed_training: bool,
      test_mode: bool,
  ) -> Dict[str, Any]:
      """
      Create a local experiment configuration based on an input configuration and
      defaults. Use a shallow merging policy to overwrite our default
      configuration with each entire subconfig specified by a user.
  
      The defaults and merging logic is not guaranteed to match the logic used by
      the Determined master. This function also does not do experiment
      configuration validation, which the Determined master does.
      """
  
      input_config = input_config.copy() if input_config else {}
      config_keys_to_ignore = {
          "bind_mounts",
          "checkpoint_storage",
          "environment",
          "resources",
          "optimizations",
      }
  
      for key in config_keys_to_ignore:
          if key not in input_config:
              continue
          # This codepath is used by checkpoint loading, where we do not want to emit any warnings,
          # so only warn if we are explicitly in --local --test mode.
          if test_mode and not managed_training:
              logger.info(
                  f"'{key}' configuration key is not supported by local test mode and will be ignored"
              )
          del input_config[key]
  
      checkpoint_storage = {
          "type": "shared_fs",
          "host_path": os.path.abspath(checkpoint_dir),
      }
  
      return {
          "checkpoint_storage": checkpoint_storage,
          **constants.DEFAULT_EXP_CFG,
          **input_config,
      }
  
imports: import contextlib
  import logging
  import math
  import os
  import pathlib
  import random
  import sys
  import uuid
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Type
  import determined
  from determined import constants, core, gpu, load
label_desc: Use image node_id 5 for calling a global function with example usage: _make_local_execution_exp_config(input_config, checkpoint_dir, managed_training, test_mode) and returns: dict