(dict_by_ref: dict, other: dict)
Recursively update ``dict_by_ref`` with values from ``other``.

    >>> nested = {"inner": {"ham": "spam"}}
    >>> deep_update(nested, {"inner": {"eggs": "spam"}})
    >>> nested == {"inner": {"ham": "spam", "eggs": "spam"}}
    True

    >>> nested = {"inner": {"ham": "spam"}}
    >>> deep_update(nested, {"inner": "SPAM"})
    >>> nested
    {'inner': 'SPAM'}
Recursively update ``dict_by_ref`` with values from ``other``.
Recursively update dict_by_ref with values from other .
def deep_update(dict_by_ref: dict, other: dict):
    """
    Recursively update ``dict_by_ref`` with values from ``other``.

    >>> nested = {"inner": {"ham": "spam"}}
    >>> deep_update(nested, {"inner": {"eggs": "spam"}})
    >>> nested == {"inner": {"ham": "spam", "eggs": "spam"}}
    True

    >>> nested = {"inner": {"ham": "spam"}}
    >>> deep_update(nested, {"inner": "SPAM"})
    >>> nested
    {'inner': 'SPAM'}

    """
    for key, value in other.items():
        if (
            key in dict_by_ref
            and isinstance(dict_by_ref[key], dict)
            and isinstance(value, dict)
        ):
            deep_update(dict_by_ref[key], value)
        else:
            dict_by_ref[key] = value
def deep_update ( dict_by_ref : dict , other : dict ) : for key , value in other . items ( ) : if ( key in dict_by_ref and isinstance ( dict_by_ref [ key ] , dict ) and isinstance ( value , dict ) ) : deep_update ( dict_by_ref [ key ] , value ) else : dict_by_ref [ key ] = value