def dict_patch(tgt_dict, src_dict):
    'Recursively patch :attr:`tgt_dict` by adding items from :attr:`src_dict`\n    that do not exist in :attr:`tgt_dict`.\n\n    If respective items in :attr:`src_dict` and :attr:`tgt_dict` are both\n    `dict`, the :attr:`tgt_dict` item is patched recursively.\n\n    Args:\n        tgt_dict (dict): Target dictionary to patch.\n        src_dict (dict): Source dictionary.\n\n    Return:\n        dict: The new :attr:`tgt_dict` that is patched.\n    '
    if (src_dict is None):
        return tgt_dict
    for (key, value) in src_dict.items():
        if (key not in tgt_dict):
            tgt_dict[key] = copy.deepcopy(value)
        elif (isinstance(value, dict) and isinstance(tgt_dict[key], dict)):
            tgt_dict[key] = dict_patch(tgt_dict[key], value)
    return tgt_dict
Recursively patch :attr:`tgt_dict` by adding items from :attr:`src_dict`
that do not exist in :attr:`tgt_dict`.

If respective items in :attr:`src_dict` and :attr:`tgt_dict` are both
`dict`, the :attr:`tgt_dict` item is patched recursively.

Args:
    tgt_dict (dict): Target dictionary to patch.
    src_dict (dict): Source dictionary.

Return:
    dict: The new :attr:`tgt_dict` that is patched.
def dict_patch(tgt_dict, src_dict):
    'Recursively patch :attr:`tgt_dict` by adding items from :attr:`src_dict`\n    that do not exist in :attr:`tgt_dict`.\n\n    If respective items in :attr:`src_dict` and :attr:`tgt_dict` are both\n    `dict`, the :attr:`tgt_dict` item is patched recursively.\n\n    Args:\n        tgt_dict (dict): Target dictionary to patch.\n        src_dict (dict): Source dictionary.\n\n    Return:\n        dict: The new :attr:`tgt_dict` that is patched.\n    '
    if (src_dict is None):
        return tgt_dict
    for (key, value) in src_dict.items():
        if (key not in tgt_dict):
            tgt_dict[key] = copy.deepcopy(value)
        elif (isinstance(value, dict) and isinstance(tgt_dict[key], dict)):
            tgt_dict[key] = dict_patch(tgt_dict[key], value)
    return tgt_dict