def collection_to_index_dict(collection):
    """
    Given a collection, give each type of the data a unique integer id
    :param collection:
    :return: a diction project object to a number
    """
    res = {}
    for i, entry in enumerate(collection):
        res[entry] = i
    return res