# Copied from https://stackoverflow.com/questions/20656135/python-deep-merge-dictionary-data
def merge(source, destination):
    for key, value in source.items():
        if isinstance(value, dict):
            # get node or create one
            node = destination.setdefault(key, {})
            merge(value, node)
        else:
            destination[key] = value

    return destination
