def recursive_update(target, mapping):
    for key, value in mapping.items():
        if value is not None:
            if key in target:
                cont = target[key]
                if isinstance(value, Mapping) and isinstance(cont, Mapping):
                    recursive_update(cont, value)
                else:
                    target[key] = value
            else:
                target[key] = value
dataset/ETHPy150Open quantmind/pulsar/pulsar/utils/structures/misc.py/recursive_update/original