def create_to_idx_dict(source):
    """ Creates a dictionary of item-specific indices form a tuple of lists. """
    idx_dict = dict()
    for i in source:
        if i not in idx_dict:
            idx_dict[i] = len(idx_dict)
    return idx_dict