code: def _merge_dict_with_types(
      dct: Dict[str, Any],
      merge_dct: Dict[str, Any],
      exclude_keys: Set[str],
  ) -> Dict[str, Any]:
      dct = copy.deepcopy(dct)
      dct = {k: v for k, v in dct.items() if k not in exclude_keys}
  
      for k, v in merge_dct.items():
          # TODO(travis): below type comparison is not perfect, as it doesn't consider the case where the default type
          # is omitted while the encoder type is explicitly set to the default type, in which case they
          # should resolve to equal, but will be considered different.
          if (
              k in dct
              and isinstance(dct[k], dict)
              and isinstance(v, Mapping)
              and dct[k].get(TYPE) == v.get(TYPE, dct[k].get(TYPE))
          ):
              dct[k] = _merge_dict_with_types(dct[k], v, exclude_keys)
          else:
              dct[k] = v
      return dct
  
imports: import copy
  import logging
  import sys
  import warnings
  from typing import Any, Dict, List, Mapping, Set, TYPE_CHECKING
  from marshmallow import ValidationError
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import CATEGORY, COMBINED, DECODER, DEFAULTS, ENCODER, GRID_SEARCH, INPUT_FEATURES, LOSS, MODEL_ECD, MODEL_LLM, OUTPUT_FEATURES, PARAMETERS, PREPROCESSING, SEQUENCE, SPACE, TEXT, TYPE
  from ludwig.features.feature_utils import compute_feature_hash
  from ludwig.schema.features.utils import output_config_registry
  from ludwig.schema.hyperopt.scheduler import BaseHyperbandSchedulerConfig
  from ludwig.schema.llms.generation import LLMGenerationConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.types import HyperoptConfigDict, ModelConfigDict
  from ludwig.utils.data_utils import get_sanitized_feature_name
  from ludwig.utils.llm_utils import get_context_len
label_desc: Use image node_id 3 for calling a global function with example usage: _merge_dict_with_types(dct, merge_dct, exclude_keys) and returns: dct