def METHOD_NAME(d: Dict, key: str):
    """
    Unsets a key
    """
    _unset(d, key)
    path = to_path(key)
    for i in reversed(range(1, len(path))):
        if len(get(d, path[:i])) == 0:
            METHOD_NAME(d, path[:i])