#
from typing import Dict


def deep_merge(source: Dict, target: Dict) -> Dict:
    """
    递归合并字典 (从source拷贝到target)
    :param source: 源字典
    :param target: 目标字典
    :return: 将源字典合并到目标字典
    """
    for key, value in source.items():
        if isinstance(value, dict) and key in target and isinstance(target[key], dict):
            target[key] = deep_merge(value, target[key])
        else:
            target[key] = value
    return target