code: def parse_config_overrides(
      config: Dict[str, Any], overrides: Iterable[str]
  ) -> Dict[str, Any]:
      for config_arg in overrides:
          if "=" not in config_arg:
              raise ValueError(
                  "Could not read configuration option '{}'\n\n"
                  "Expecting:\n{}".format(config_arg, CONFIG_DESC)
              )
  
          key, value = config_arg.split(
              "=", maxsplit=1
          )  # type: Tuple[str, Any]
  
          # Complex objects may contain commas but are not intended to be split
          # on commas and have their parts parsed separately.
          if value.startswith(("[", "{")):
              # Certain configurations keys are expected to have list values.
              # Convert a single value to a singleton list if needed.
              if (
                  key in _CONFIG_PATHS_COERCE_TO_LIST
                  and value.startswith("{")
              ):
                  value = [util.yaml_safe_load(value)]
              else:
                  value = util.yaml_safe_load(value)
          # Separate values if a comma exists. Use yaml_safe_load() to cast
          # the value(s) to the type YAML would use, e.g., "4" -> 4.
          elif "," in value:
              value = [util.yaml_safe_load(v) for v in value.split(",")]
          else:
              value = util.yaml_safe_load(value)
              # Certain configurations keys are expected to have list values.
              # Convert a single value to a singleton list if needed.
              if key in _CONFIG_PATHS_COERCE_TO_LIST:
                  value = [value]
  
          # Convert config override in dot notation to json path
          config_arg_in_json = _dot_to_json(key, value)
  
          # Some key may have value None of NoneType when value is not defined.
          # For example, when parent key "slurm" is specified in experiment .yaml file without
          # any child key, the config will contain None value for key 'slurm':
          # {'name': 'noop_single', ..., 'entrypoint': 'model_def:NoOpTrial', 'slurm': None}
          # This NoneType value None will raise TypeError if used, for example:
          # TypeError: argument of type 'NoneType' is not iterable
          # TypeError: 'NoneType' object does not support item assignment
          # Before we can merge the config from the exp .yaml file with the config_arg
          # provided from the command line, we need to convert NoneType value None in
          # config to empty string {}. We only convert the None value for the key
          # specified in config_arg in overrides, for the example above, if the override
          # is "--config slurm.sbatch_args=[--mem-per-gpu=1g]", we will convert the
          # " 'slurm': None " to " 'slurm': {} " in config before pass it to merge_dicts
          # function.
          _replace_value(config, key.split("."), None, {})
          # Merge two objects in json format
          config = merge_dicts(config, config_arg_in_json)
  
      return config
  
imports: import base64
  import json
  import operator
  import re
  from argparse import Namespace
  from collections import OrderedDict
  from functools import reduce
  from pathlib import Path
  from typing import IO, Any, Dict, Iterable, List, Optional, Tuple, Union
  from termcolor import colored
  import determined.cli.render
  from determined import cli
  from determined.cli import render
  from determined.common import api, context, declarative_argparse, util
  from determined.common.api import authentication
  from determined.util import merge_dicts
label_desc: Use image node_id 9 for calling a global function with example usage: parse_config_overrides(config, overrides) and returns: config