code: def parse_config_overrides(
      args: List[str],
      env_var: Optional[str] = ENV_VARS.CONFIG_OVERRIDES,
  ) -> Dict[str, Any]:
      """Generate a dictionary of config overrides based on the extra arguments
      provided on the CLI, e.g. --training.batch_size to override
      "training.batch_size". Arguments without a "." are considered invalid,
      since the config only allows top-level sections to exist.
  
      env_vars (Optional[str]): Optional environment variable to read from.
      RETURNS (Dict[str, Any]): The parsed dict, keyed by nested config setting.
      """
      env_string = os.environ.get(env_var, "") if env_var else ""
      env_overrides = _parse_overrides(split_arg_string(env_string))
      cli_overrides = _parse_overrides(args, is_cli=True)
      if cli_overrides:
          keys = [k for k in cli_overrides if k not in env_overrides]
          logger.debug("Config overrides from CLI: %s", keys)
      if env_overrides:
          logger.debug(
              "Config overrides from env variables: %s",
              list(env_overrides),
          )
      return {**cli_overrides, **env_overrides}
  
imports: import hashlib
  import os
  import shutil
  import sys
  from configparser import InterpolationError
  from contextlib import contextmanager
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union, overload
  import srsly
  import typer
  from click import NoSuchOption
  from click.parser import split_arg_string
  from thinc.api import Config, ConfigValidationError, require_gpu
  from thinc.util import gpu_is_available
  from typer.main import get_command
  from wasabi import Printer, msg
  from weasel import app
  from ..None import about
  from ..compat import Literal
  from ..schemas import validate
  from ..util import ENV_VARS, SimpleFrozenDict, import_file, is_compatible_version, logger, make_tempdir, registry, run_command
label_desc: Use image node_id 2 for calling a global function with example usage: parse_config_overrides(args, env_var) and returns: dict