from typing import Mapping
from typing import Dict


def reverse_dict(d:Mapping) -> Dict:
    """ Create a new dictionary in which the keys and values of `d` are switched
    
    In the case of duplicate values, it is arbitrary which will be retained.
    
    Parameters
    ----------
    d : typing.Mapping
        The mapping
        
    Returns
    -------
    reversed_d : typing.Dict
        A dictionary in which the values of `d` now map to the keys
    """
    reverse_d = {v:k for k,v in d.items()}    
    return reverse_d