Returns sorted array without duplicates
@param list {Array} array to be sorted
@returns {Array} sorted array
489014
function(list){
    const listNoDuplicate = difference([],list);
    if(typeof list[0] == "number") {
      return listNoDuplicate.sort((a,b)=>a-b);
    }

    return listNoDuplicate.sort();
  }
1199625
function stableSort(arr, sortFunction) {
	var length = arr.length,
		i;

	// Add index to each item
	for (i = 0; i < length; i++) {
		arr[i].ss_i = i; // stable sort index
	}

	arr.sort(function (a, b) {
		var sortValue = sortFunction(a, b);
		return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
	});

	// Remove index from items
	for (i = 0; i < length; i++) {
		delete arr[i].ss_i; // stable sort index
	}
}
1026226
def get_not_unique_values(array):
    '''
    '''
    s = np.sort(array, axis=None)
    s = s[s[1:] == s[:-1]]
    return np.unique(s)
1314626
private static <T> ArrayList<T> sorted(Collection<T> cls, Comparator<? super T> c) {
    ArrayList<T> sorted = new ArrayList<>(cls);
    sorted.sort(c);
    return sorted;
  }
1140762
protected List<T> sort(final List<T> unsortedList)
	{
		final SortParam<S> sortParam = getSort();
		if (sortParam != null)
		{
			final String property = (String)sortParam.getProperty();
			final boolean ascending = sortParam.isAscending();
			ListExtensions.sortByProperty(unsortedList, property, ascending);
		}
		return unsortedList;
	}
298637
function orderBy(array, sortPredicate, reverseOrder) {
  if (!isArrayLike(array)) {
    return array;
  }
  sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate];
  if (sortPredicate.length === 0) { sortPredicate = ['+']; }
  sortPredicate = sortPredicate.map(function(predicate) {
    var descending = false;
    var get = predicate || value;
    if (isString(predicate)) {
      if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
        descending = predicate.charAt(0) == '-';
        predicate = predicate.substring(1);
      }
      if (predicate === '') {
        // Effectively no predicate was passed so we compare identity
        return reverseComparator(function(a, b) {
          return compare(a, b);
        }, descending);
      }
      get = $parse(predicate);
      if (get.constant) {
        var key = get();
        return reverseComparator(function(a, b) {
          return compare(a[key], b[key]);
        }, descending);
      }
    }
    return reverseComparator(function(a, b) {
      return compare(get(a),get(b));
    }, descending);
  });
  var arrayCopy = [];
  for (var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
  return arrayCopy.sort(reverseComparator(comparator, reverseOrder));

  function comparator(o1, o2) {
    for (var i = 0; i < sortPredicate.length; i++) {
      var comp = sortPredicate[i](o1, o2);
      if (comp !== 0) break;
    }
    return comp;
  }
  function reverseComparator(comp, descending) {
    return descending
      ? function(a, b) {return comp(b,a);}
      : comp;
  }
  function compare(v1, v2) {
    var t1 = typeof v1;
    var t2 = typeof v2;
    if (t1 == t2) {
      if (isDate(v1) && isDate(v2)) {
        v1 = v1.valueOf();
        v2 = v2.valueOf();
      }
      if (t1 == "string") {
        v1 = v1.toLowerCase();
        v2 = v2.toLowerCase();
      }
      if (v1 === v2) return 0;
      return v1 < v2 ? -1 : 1;
    } else {
      return t1 < t2 ? -1 : 1;
    }
  }
}
867235
function sort(array, compare) {
  if (array.length <= 1) {
    return array;
  }

  var i;
  var middle = Math.floor(array.length / 2);
  var left = new Array(middle);
  var right = new Array(array.length - middle);

  for (i = 0; i < left.length; i++) {
    left[i] = array[i];
  }
  for (i = 0; i < right.length; i++) {
    right[i] = array[i + left.length];
  }

  return merge(sort(left, compare), sort(right, compare), compare);
}
1246627
function(sort) {
  this._array = [];
  this._sort = sort;

  Object.defineProperty(this, 'length', {
    enumerable: true,
    get: function() { return this._array.length },
  });

  if (typeof this._sort !== 'function') {
    this._sort = function(a, b) {
      return a - b;
    }
  }
}
708409
def remove_duplicates(items):
    
    if items is None:
        return items

    new_list = []
    for item in items:
        if item not in new_list:
            new_list.append(item)
    return new_list
828681
function unique(list) {
  return Object.keys(list.reduce((obj, key) => {
    if (!hasProp.call(obj, key)) {
      obj[key] = true;
    }
    return obj;
  }, {}));
}
1334274
function array_unique(l){
			var i=0,n=l.length,k={},a=[];
			while(i<n) {
				k[l[i]] || (k[l[i]] = 1 && a.push(l[i]));
				i++;
			}
			return a;
		}
1325059
function( array ){
	var i = array.length, j, swap;
	while( i ){
		j = Math.floor( Math.random() * i-- );
		swap = array[i];
		array[i] = array[j];
		array[j] = swap;
	}
	return array;
}
1082460
function(list) {
            if (isArray(list.value)) {
                list.value = list.value.reverse();
            }

            return list;
        }
658546
public static <T, L extends List<T>> L sortThis(L list, Comparator<? super T> comparator)
    {
        if (list instanceof MutableList)
        {
            ((MutableList<T>) list).sortThis(comparator);
        }
        else if (list instanceof ArrayList)
        {
            ArrayListIterate.sortThis((ArrayList<T>) list, comparator);
        }
        else
        {
            if (list.size() > 1)
            {
                Collections.sort(list, comparator);
            }
        }
        return list;
    }
648119
function(array) {
            for (var i = 1, ln = array.length; i < ln; i++) {
                var j = Math.floor(Math.random() * (i + 1)),
                    tmp = array[i];
                array[i] = array[j];
                array[j] = tmp;
            }

            return array;
        }
531233
function (list) {
		var items = [];
		var i = 0;
		var listLength = list.length;

		for (; i < listLength; i++) {
			items.push(list[i]);
		}

		return items;
	}
1298604
function listToArray(list) {
  if(isFunction(list)) {
    return function(x) {
      const m = list(x)

      if(!isSameType(List, m)) {
        throw new TypeError('listToArray: List returning function required')
      }

      return m.toArray()
    }
  }

  if(isSameType(List, list)) {
    return list.toArray()
  }

  throw new TypeError('listToArray: List or List returning function required')
}