def _reverse(object2idx):
    """
    Reverse 1-to-1 mapping function.
    
    Return reversed mapping.
    
    :param object2idx: Mapping of objects to indices or vice verse.
    :type object2idx: `dict`
    :rtype: `dict`
    """
    return dict(list(zip(list(object2idx.values()), list(object2idx.keys()))))