code: def overwrite_dictionary(
      base_dictionary: dict,
      dictionary_with_overwrites: dict,
  ) -> dict:
      for key, value in dictionary_with_overwrites.items():
          if key in base_dictionary:
              base_dictionary_entry = base_dictionary[key]
              if isinstance(base_dictionary_entry, list):
                  assert isinstance(value, list)
                  value += base_dictionary_entry
              if isinstance(base_dictionary_entry, dict):
                  assert isinstance(value, dict)
                  value.update(base_dictionary_entry)
  
          base_dictionary[key] = value
  
      return base_dictionary
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/jumpstart/utils.py
imports: from __future__ import absolute_import
  import copy
  from typing import List
  import boto3
  from sagemaker.jumpstart.cache import JumpStartModelsCache
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_LOGGER, JUMPSTART_REGION_NAME_SET
  from sagemaker.jumpstart.types import JumpStartCachedS3ContentKey, JumpStartCachedS3ContentValue, JumpStartModelSpecs, JumpStartS3FileType, JumpStartModelHeader
  from sagemaker.jumpstart.utils import get_formatted_manifest
  from tests.unit.sagemaker.jumpstart.constants import PROTOTYPICAL_MODEL_SPECS_DICT, BASE_MANIFEST, BASE_SPEC, BASE_HEADER, SPECIAL_MODEL_SPECS_DICT
label_desc: Use image node_id 8 for calling a global function with example usage: overwrite_dictionary(base_dictionary, dictionary_with_overwrites) and returns: base_dictionary