def METHOD_NAME(D):
    """
    Return a dict having D.values() as its keys and D.keys() as its values.
    """
    E = {}
    for k, v in D.items():
        if v in E:
            raise KeyError(
                "Cannot reverse this mapping, as it is not one-to-one "
                f"('{v}' would map to both '{E[v]}' and '{k}')"
            )
        E[v] = k
    return E