def recursive_update(target, new):
    """
    Recursively update one dictionary in-place using another.

    None values will delete their keys.
    """
    for k, v in new.items():
        if isinstance(v, dict):
            if k not in target:
                target[k] = {}
            recursive_update(target[k], v)

        elif v is None:
            target.pop(k, None)

        else:
            target[k] = v
Recursively update one dictionary in-place using another.

None values will delete their keys.
jupyterhub/utils.py