Pack all data in the sequence into a list
    :param expr:
    :param unique: make every elements in the sequence to be unique
    :return:
181902
def tolist(expr, **kwargs):
    
    unique = kwargs.get('unique', kwargs.get('_unique', False))
    output_type = None

    if isinstance(expr, (SequenceExpr, SequenceGroupBy)):
        output_type = types.List(expr._data_type)
    return _reduction(expr, ToList, output_type, _unique=unique)
1328092
def ordered_uniqify(sequence):
    

    items = set()
    return [key for key in sequence if key not in items and not items.add(key)]
601747
def unique(iterable):
    
    seen = set()
    return [x for x in iterable if x not in seen and not seen.add(x)]
368583
def unique(iterable):
    """"""
    seen = set()
    for item in iterable:
        if item not in seen:
            seen.add(item)
            yield item
389847
def unique(objects, key=None):
    
    dupl = []
    for obj, group in itertools.groupby(sorted(objects), key):
        if sum(1 for _ in group) > 1:
            dupl.append(obj)
    if dupl:
        raise ValueError('Found duplicates %s' % dupl)
    return objects
1366429
def _unique(list_of_dicts):
    '''
    
    '''
    unique_list = []
    for ele in list_of_dicts:
        if ele not in unique_list:
            unique_list.append(ele)
    return unique_list
1248096
def unique_list(input_, key=lambda x:x):
    """"""
    seen = set()
    output = []
    for x in input_:
        keyx = key(x)
        if keyx not in seen:
            seen.add(keyx)
            output.append(x)
    return output
1130970
def uniq(seq):
    
    seen = set()
    return [x for x in seq if str(x) not in seen and not seen.add(str(x))]
874030
def unique_values(func):
    

    @wraps(func)
    def wrapper(*args, **kwargs):
        return unique_everseen(func(*args, **kwargs))

    return wrapper
474358
public static Set<Writable> getUniqueSequence(String columnName, Schema schema,
                                                   SequenceRecordReader sequenceData) {
        int colIdx = schema.getIndexOfColumn(columnName);
        Set<Writable> unique = new HashSet<>();
        while(sequenceData.hasNext()){
            List<List<Writable>> next = sequenceData.sequenceRecord();
            for(List<Writable> step : next){
                unique.add(step.get(colIdx));
            }
        }
        return unique;
    }
930324
def inverable_unique_two_lists(item1_list, item2_list):
    
    import utool as ut
    unique_list1, inverse1 = np.unique(item1_list, return_inverse=True)
    unique_list2, inverse2 = np.unique(item2_list, return_inverse=True)

    flat_stacked, cumsum = ut.invertible_flatten2((unique_list1, unique_list2))
    flat_unique, inverse3 = np.unique(flat_stacked, return_inverse=True)
    reconstruct_tup = (inverse3, cumsum, inverse2, inverse1)
    return flat_unique, reconstruct_tup
917155
def remove_duplicates(vector_tuple):
    
    array = np.column_stack(vector_tuple)
    a = np.ascontiguousarray(array)
    unique_a = np.unique(a.view([('', a.dtype)]*a.shape[1]))
    b = unique_a.view(a.dtype).reshape((unique_a.shape[0], a.shape[1]))
    return list(b.T)
895619
def get_unique_fields(cls):
        
        unique_fields = []

        for fname, field in cls.__dict__.items():
            if isinstance(field, models.fields.Field):
                if getattr(field,'unique',False):
                    try:
                        field.unique = False
                    except AttributeError:
                        # newer Django defines unique as a property
                        # that uses _unique to store data.  We're
                        # jumping over the fence by setting _unique,
                        # so this sucks, but this happens early enough
                        # to be safe.
                        field._unique = False
                    unique_fields.append(fname)
        return unique_fields
1276420
def code(self):
        

        def uniq(seq):
            """
            Utility function that removes duplicate.
            """
            seen = set()
            seen_add = seen.add
            # This way removes duplicates while preserving the order.
            return [x for x in seq if x not in seen and not seen_add(x)]

        data_set = uniq(i for i in self.autos if i is not None)
        error_list = uniq(i for i in self.errors if i is not None)
        if error_list:
            return "\n".join(error_list)
        return "\n".join(data_set)
889016
def unique_otuids(groups):
    
    uniques = {key: set() for key in groups}
    for i, group in enumerate(groups):
        to_combine = groups.values()[:i]+groups.values()[i+1:]
        combined = combine_sets(*to_combine)
        uniques[group] = groups[group].difference(combined)
    return uniques
789791
def build(cls, seqs: Iterable[int], uid: bool = False) -> 'SequenceSet':
        
        seqs_list = sorted(set(seqs))
        groups: List[Union[int, Tuple[int, int]]] = []
        group: Union[int, Tuple[int, int]] = seqs_list[0]
        for i in range(1, len(seqs_list)):
            group_i = seqs_list[i]
            if isinstance(group, int):
                if group_i == group + 1:
                    group = (group, group_i)
                else:
                    groups.append(group)
                    group = group_i
            elif isinstance(group, tuple):
                if group_i == group[1] + 1:
                    group = (group[0], group_i)
                else:
                    groups.append(group)
                    group = group_i
        groups.append(group)
        return SequenceSet(groups, uid)
1132506
def make_fields_unique(self, fields):
        
        for i in range(0, len(fields)):
            for j in range(i+1, len(fields)):
                if fields[i] == fields[j]:
                    fields[j] += "'"