def generate_reverse_dict(dict_in):
    """Generate the reverse dictionary: (value, key) out of (key, value).
    The values in dict_in must be unique.
    """
    return dict((v, k) for k, v in dict_in)