Heuristic method to return the uniques within some precision in a numpy array
428695
def nearly_unique(arr, rel_tol=1e-4, verbose=0):
    ''''''
    results = np.array([arr[0]])
    for x in arr:
        if np.abs(results - x).min() > rel_tol:
            results = np.append(results, x)
    return results
267801
def unique(self, sort=False):
        
        unique_vals = np.unique(self.numpy())
        if sort:
            unique_vals = np.sort(unique_vals)
        return unique_vals
53932
def sum_of_reoccurring_values(x):
    
    unique, counts = np.unique(x, return_counts=True)
    counts[counts < 2] = 0
    counts[counts > 1] = 1
    return np.sum(counts * unique)
880643
def uniqued(iterable):
    
    seen = set()
    add = seen.add
    return [i for i in iterable if i not in seen and not add(i)]
729085
public static int[] unique(int[] arrays, int min, int max) {
        List<Integer> list = new ArrayList<>(arrays.length);
        for (int arr : arrays) {
            if (!list.contains(arr) && arr >= min && arr <= max) {
                list.add(arr);
            }
        }
        int[] res = new int[list.size()];
        int i = 0;
        for (int arr : list) {
            res[i++] = arr;
        }
        return res;
    }
821694
def unique(seq):
    """"""
    cleaned = []
    for each in seq:
        if each not in cleaned:
            cleaned.append(each)
    return cleaned
1259126
function unique(arr) {
  var ret = [];

  for (var i = 0; i < arr.length; i++) {
    if (~ret.indexOf(arr[i])) continue;
    ret.push(arr[i]);
  }

  return ret;
}
723077
def unique(series: pd.Series) -> pd.Series:
    """"""
    return ~series.duplicated(keep=False)
631581
function unique( arr, sort, uniqueFn ){
	var rtn = [];

	if ( arr.length ){
		if ( sort ){
			// more efficient because I can presort
			if ( bmoor.isFunction(sort) ){
				arr = arr.slice(0).sort(sort);
			}

			let last;
			
			for( let i = 0, c = arr.length; i < c; i++ ){
				let d = arr[i],
					v = uniqueFn ? uniqueFn(d) : d;

				if ( v !== last ){
					last = v;
					rtn.push( d );
				}
			}
		}else if ( uniqueFn ){
			let hash = {};

			for( let i = 0, c = arr.length; i < c; i++ ){
				let d = arr[i],
					v = uniqueFn(d);

				if ( !hash[v] ){
					hash[v] = true;
					rtn.push( d );
				}
			}
		}else{
			// greedy and inefficient
			for( let i = 0, c = arr.length; i < c; i++ ){
			 	let d = arr[i];

			 	if ( rtn.indexOf(d) === -1 ){
			 		rtn.push( d );
			 	}
			}
		}
	}

	return rtn;
}
52227
def unique(seq):
    """"""
    seen = {}
    result = []
    for item in seq:
        marker = item
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result
370891
def unique_array(arr):
    
    if not len(arr):
        return np.asarray(arr)
    elif pd:
        if isinstance(arr, np.ndarray) and arr.dtype.kind not in 'MO':
            # Avoid expensive unpacking if not potentially datetime
            return pd.unique(arr)

        values = []
        for v in arr:
            if (isinstance(v, datetime_types) and
                not isinstance(v, cftime_types)):
                v = pd.Timestamp(v).to_datetime64()
            values.append(v)
        return pd.unique(values)
    else:
        arr = np.asarray(arr)
        _, uniq_inds = np.unique(arr, return_index=True)
        return arr[np.sort(uniq_inds)]
577254
def unique(lst):
    
    lst = lst[:]
    unique_lst = []

    # Cycle through the list and add each value to the unique list only once.
    for item in lst:
        if unique_lst.count(item) <= 0:
            unique_lst.append(item)
            
    # Return the list with all redundant values removed.
    return unique_lst
1015860
public static int[] unique(int[] x) {
        HashSet<Integer> hash = new HashSet<>();
        for (int i = 0; i < x.length; i++) {
            hash.add(x[i]);
        }

        int[] y = new int[hash.size()];

        Iterator<Integer> keys = hash.iterator();
        for (int i = 0; i < y.length; i++) {
            y[i] = keys.next();
        }

        return y;
    }
120832
def unique(values):
    '''
    
    '''
    ret = None
    if isinstance(values, collections.Hashable):
        ret = set(values)
    else:
        ret = []
        for value in values:
            if value not in ret:
                ret.append(value)
    return ret
410312
def uniqueof20(k, rep=10000):
    """"""
    alphabet = 'ACDEFGHIKLMNPQRSTVWY'
    reps = [len(set(random.choice(alphabet)
                    for i in range(k)))
            for j in range(rep)]
    return sum(reps) / len(reps)
420558
def unique(list1, list2):
    
    set2 = set(list2)
    list1_unique = [x for x in tqdm(list1, desc='Unique', total=len(list1)) if x not in set2]
    return list1_unique
874030
def unique_values(func):
    

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

    return wrapper