returns a sorted unique copy of ints.
196084
static int[] uniquify(int[] ints, int start, int end) {
        IntSet iset = new IntSet();
        for (int i = end; --i >= start; ) {
            iset.add(ints[i]);
        }
        return iset.toIntArray();
    }
1283657
function unique (array) {
    var ret = [];

    array.forEach(function (val) {
        if (ret.indexOf(val) === -1) {
            ret.push(val);
        }
    });

    return ret;
}
790695
def unique(iterable):
    
    """
    d = {}
    return (d.setdefault(x,x) for x in iterable if x not in d)
1037557
public static <T> Iterator<T> unique(Iterator<T> self, Comparator<T> comparator) {
        return toList((Iterable<T>) unique(toList(self), comparator)).listIterator();
    }
346753
def _get_int(data, position, dummy0, dummy1, dummy2):
    """"""
    end = position + 4
    return _UNPACK_INT(data[position:end])[0], end
196823
def uniq(self, isSorted=False, iterator=None):
        
        ns = self.Namespace()
        ns.results = []
        ns.array = self.obj
        initial = self.obj
        if iterator is not None:
            initial = _(ns.array).map(iterator)

        def by(memo, value, index):
            if ((_.last(memo) != value or
                 not len(memo)) if isSorted else not _.include(memo, value)):
                memo.append(value)
                ns.results.append(ns.array[index])

            return memo

        ret = _.reduce(initial, by)
        return self._wrap(ret)
303476
function unique( arr, sorted ) {
	if ( !Array.isArray( arr ) ) {
		throw new TypeError( 'unique()::invalid input argument. First argument must be an array.' );
	}
	if ( arguments.length > 1 && typeof sorted !== 'boolean' ) {
		throw new TypeError( 'unique()::invalid input argument. Second argument must be an array.' );
	}
	var len = arr.length,
		i, j,
		val;

	if ( !len ) {
		return;
	}
	if ( !sorted ) {
		arr.sort( ascending );
	}
	// Loop through the array, only incrementing a pointer when successive values are different. When a succeeding value is different, move the pointer and set the next value. In the trivial case where all array elements are unique, we incur a slight penalty in resetting the element value for each unique value. In other cases, we simply move a unique value to a new position in the array. The end result is a sorted array with unique values.
	for ( i = 1, j = 0; i < len; i++ ) {
		val = arr[ i ];
		if ( arr[ j ] !== val ) {
			j++;
			arr[ j ] = val;
		}
	}
	// Truncate the array:
	arr.length = j+1;
}
707150
def uniqueify(x:Series, sort:bool=False)->List:
    ""
    res = list(OrderedDict.fromkeys(x).keys())
    if sort: res.sort()
    return res
514697
private static <V> Collection<V> sorted(Iterable<V> source, Comparator<V> comparator, int size)
    {
        V[] vs = (V[]) new Object[size];
        int i = 0;
        for (V v : source)
            vs[i++] = v;
        Arrays.sort(vs, comparator);
        return Arrays.asList(vs);
    }
1012675
function uniqueArray(src, key, sort) {
    var results = [];
    var values = [];
    var i = 0;

    while (i < src.length) {
        var val = key ? src[i][key] : src[i];
        if (inArray(values, val) < 0) {
            results.push(src[i]);
        }
        values[i] = val;
        i++;
    }

    if (sort) {
        if (!key) {
            results = results.sort();
        } else {
            results = results.sort(function sortUniqueArray(a, b) {
                return a[key] > b[key];
            });
        }
    }

    return results;
}
41505
def natural_sorted(iterable):
    
    def sortkey(x):
        return [(int(c) if c.isdigit() else c) for c in re.split(numbers, x)]

    numbers = re.compile(r'(\d+)')
    return sorted(iterable, key=sortkey)
924952
public static <INPUT extends Comparable<INPUT>> Iterable<List<INPUT>> toUniqueAndSortedPartitions(Collection<INPUT> inputs) {
    return toUniqueAndSortedPartitions(inputs, i -> i);
  }
612037
def unique(_list):
    
    ret = []

    for item in _list:
        if item not in ret:
            ret.append(item)

    return ret
98749
def copy(self):
        
        dup = type(self)()
        dup._indices = OrderedDict(
            (k, list(v)) for k,v in six.iteritems(self._indices)
        )
        dup._lines = self._lines.copy()
        return dup
65502
public @Nonnull Iterable<Integer> ints() {
        final JsonArray parent=this;
        return () -> {
            final Iterator<JsonElement> iterator = parent.iterator();
            return new Iterator<Integer>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
                }

                @Override
                public Integer next() {
                    return iterator.next().asInt();
                }

                @Override
                public void remove() {
                    iterator.remove();
                }
            };
        };
    }
1077857
function unique(value) {
    return value.reduce((memo, current) => {
        return memo.indexOf(current) !== -1 ? memo : memo.concat(current);
    }, []);
}
564008
def _avoid_duplicate_arrays(types):
    
    arrays = [t for t in types if isinstance(t, dict) and t["type"] == "array"]
    others = [t for t in types if not (isinstance(t, dict) and t["type"] == "array")]
    if arrays:
        items = set([])
        for t in arrays:
            if isinstance(t["items"], (list, tuple)):
                items |= set(t["items"])
            else:
                items.add(t["items"])
        if len(items) == 1:
            items = items.pop()
        else:
            items = sorted(list(items))
        arrays = [{"type": "array", "items": items}]
    return others + arrays