Sorts a bound array.
974699
protected static void sortBound (double[] bound, int bc) {
        for (int i = 0; i < bc - 4; i += 4) {
            int k = i;
            for (int j = i + 4; j < bc; j += 4) {
                if (bound[k] > bound[j]) {
                    k = j;
                }
            }
            if (k != i) {
                double tmp = bound[i];
                bound[i] = bound[k];
                bound[k] = tmp;
                tmp = bound[i + 1];
                bound[i + 1] = bound[k + 1];
                bound[k + 1] = tmp;
                tmp = bound[i + 2];
                bound[i + 2] = bound[k + 2];
                bound[k + 2] = tmp;
                tmp = bound[i + 3];
                bound[i + 3] = bound[k + 3];
                bound[k + 3] = tmp;
            }
        }
    }
224080
function sortArrayByIndex(array) {

  let ii = 0;
  let length = array.length;

  let output = [];

  for (; ii < length; ++ii) {
    output[array[ii].index] = array[ii];
    delete array[ii].index;
  };

  return (output);

}
184226
private void sortArrayList(List<InvPair> v) {
        Collections.sort(v, new Comparator<InvPair>() {

            @Override
            public int compare(InvPair o1, InvPair o2) {
                if (o1.getCurr() > o2.getCurr()) return +1;
                if (o1.getCurr() < o2.getCurr()) return -1;
                return 0;
            }
        });
        Collections.sort(v, new Comparator<InvPair>() {

            @Override
            public int compare(InvPair o1, InvPair o2) {
                if (o1.getLast() > o2.getLast()) return +1;
                if (o1.getLast() < o2.getLast()) return -1;
                return 0;
            }
        });
    }
1368527
public static <E extends Comparable<E>> void sortDescending(E[] intArray) {
        Merge.sort(intArray, 0, intArray.length-1, true);
    }
698922
public static <T> T[] sort(T[] self, Comparator<T> comparator) {
        return sort(self, true, comparator);
    }
103277
public static void sortDescending(byte[] byteArray) {
        int index = 0;
        byte value = 0;
        
        for(int i = 1; i < byteArray.length; i++) {
            index = i;
            value = byteArray[index];
            
            while(index > 0 && value > byteArray[index - 1]) {
                byteArray[index] = byteArray[index - 1];
                
                index--;
            }
            
            byteArray[index] = value;
        }
    }
453123
static double[] sortAndRevert(final double[] array) {
		final int[] indexes = sort(array);

		// Copy the elements in reversed order.
		final double[] result = new double[array.length];
		for (int i = 0; i < result.length; ++i) {
			result[indexes[result.length - 1 - i]] = array[indexes[i]];
		}

		return result;
	}
804342
function arraySort (arr, iterate, context, STR_UNDEFINED) {
  if (arr) {
    if (iterate === STR_UNDEFINED) {
      return toArray(arr).sort(sortByDef)
    }
    var compares
    var list = arrayMap(arr, function (item) {
      return { data: item }
    })
    var sortPros = getSortPros(arr, list, iterate, context || this)
    var len = sortPros.length
    if (len) {
      while (len >= 0) {
        compares = sortMultis(len, compares)
        len--
      }
      list = list.sort(compares)
    }
    return arrayMap(list, baseExports.property('data'))
  }
  return []
}
243274
public void sort( int data[] , int begin , int end ) {
		histogram.fill(0);

		for( int i = begin; i < end; i++ ) {
			histogram.data[data[i]-minValue]++;
		}

		// over wrist the input data with sorted elements
		int index = begin;
		for( int i = 0; i < histogram.size; i++ ) {
			int N = histogram.get(i);
			int value = i+minValue;
			for( int j = 0; j < N; j++ ) {
				data[index++] = value;
			}
		}
	}
1347541
@Deprecated
    public static <T> void sort(T[] array, int size, Comparator<? super T> comparator)
    {
        if (comparator == null)
        {
            Arrays.sort(array, 0, size); // handles case size < 2 in Java 8 ComparableTimSort
        }
        else
        {
            Arrays.sort(array, 0, size, comparator); // handles case size < 2 in Java 8 TimSort
        }
    }
299309
public static <E extends Comparable<E>> void sortDescending(E[] intArray) {
        Quicksort.sort(intArray, 0, intArray.length - 1 , true);
    }
59468
public static void sort(final int[] array, int offset, int end, int shift, final Queue<Future<?>> futures) {
		final int BITS_PER_PASS;
		if(ENABLE_CONCURRENCY && (shift + R_BITS_PER_PASS)==32) {
			BITS_PER_PASS = FIRST_BITS_PER_PASS;
		} else {
			BITS_PER_PASS = R_BITS_PER_PASS;
		}
		final int PASS_SIZE = 1 << BITS_PER_PASS;
		final int PASS_MASK = PASS_SIZE - 1;

		int[] last = new int[PASS_SIZE];
		final int[] pointer = new int[PASS_SIZE];

		for (int x=offset; x<end; ++x) {
			++last[((array[x]+UNSIGNED_OFFSET) >> shift) & PASS_MASK];
		}

		last[0] += offset;
		pointer[0] = offset;
		for (int x=1; x<PASS_SIZE; ++x) {
			pointer[x] = last[x-1];
			last[x] += last[x-1];
		}

		for (int x=0; x<PASS_SIZE; ++x) {
			while (pointer[x] != last[x]) {
				int value = array[pointer[x]];
				int y = ((value+UNSIGNED_OFFSET) >> shift) & PASS_MASK;
				while (x != y) {
					int temp = array[pointer[y]];
					array[pointer[y]++] = value;
					value = temp;
					y = ((value+UNSIGNED_OFFSET) >> shift) & PASS_MASK;
				}
				array[pointer[x]++] = value;
			}
		}
		if (shift > 0) {
			// TODO: Additional criteria
			shift -= BITS_PER_PASS;
			for (int x=0; x<PASS_SIZE; ++x) {
				final int size = x > 0 ? (pointer[x] - pointer[x-1]) : (pointer[0] - offset);
				if (size > 64) {
					final int newOffset = pointer[x] - size;
					final int newEnd = pointer[x];
					if(
						ENABLE_CONCURRENCY
						&& (newEnd-newOffset) >= MIN_CONCURRENCY_SIZE
					) {
						final int finalShift = shift;
						futures.add(
							executor.submit(
								new Runnable() {
									@Override
									public void run() {
										sort(array, newOffset, newEnd, finalShift, futures);
									}
								}
							)
						);
					} else {
						sort(array, newOffset, newEnd, shift, futures);
					}
				} else if (size > 1) {
					insertionSort(array, pointer[x] - size, pointer[x]);
					// Arrays.sort(array, pointer[x] - size, pointer[x]);
				}
			}
		}
	}
333234
public static <T extends Comparable<? super T>> void quicksort( T[] arr )
    {
        quicksort( arr, 0, arr.length - 1 );
    }
926501
private static int sortAbstractLongArray(Block array, long[] buffer, AbstractType type)
    {
        int arraySize = array.getPositionCount();
        int nonNullSize = 0;
        for (int i = 0; i < arraySize; i++) {
            if (!array.isNull(i)) {
                buffer[nonNullSize++] = type.getLong(array, i);
            }
        }
        for (int i = 1; i < nonNullSize; i++) {
            if (buffer[i - 1] > buffer[i]) {
                Arrays.sort(buffer, 0, nonNullSize);
                break;
            }
        }
        return nonNullSize;
    }
1240912
def sort_dict(self, data, key):
    ''''''
    return sorted(data, key=itemgetter(key)) if data else []
808810
private static void checkSorted(int[] sorted) {
    for (int i = 0; i < sorted.length-1; i++) {
      if (sorted[i] > sorted[i+1]) {
        throw new RuntimeException("input must be sorted!");
      }
    }
  }
1291018
function sort(array, radix) {
  if (array.length === 0) {
    return array;
  }

  radix = radix || 10;

  // Determine minimum and maximum values
  var minValue = array[0];
  var maxValue = array[0];
  for (var i = 1; i < array.length; i++) {
    if (array[i] < minValue) {
      minValue = array[i];
    } else if (array[i] > maxValue) {
      maxValue = array[i];
    }
  }

  // Perform counting sort on each exponent/digit, starting at the least
  // significant digit
  var exponent = 1;
  while ((maxValue - minValue) / exponent >= 1) {
    array = countingSortByDigit(array, radix, exponent, minValue);

    exponent *= radix;
  }

  return array;
}