def merge_dicts(base, updates):
    for key, value in updates.items():
        # Dict values whose keys also exist in 'base' -> recurse
        # (But only if both types are dicts.)
        if key in base:
            if isinstance(value, dict):
                if isinstance(base[key], dict):
                    merge_dicts(base[key], value)
                else:
                    raise _merge_error(base[key], value)
            else:
                if isinstance(base[key], dict):
                    raise _merge_error(base[key], value)
                else:
                    base[key] = value
        # New values just get set straight
        else:
            base[key] = value
Recursively merge dict ``updates`` into dict ``base`` (mutating ``base``.)
dataset/ETHPy150Open pyinvoke/invoke/invoke/config.py/merge_dicts