+ Jonas Raoni Soares Silva @ http://jsfromhell.com/array/shuffle [rev. #1]
11350
function shuffle(v) {
  for (var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
  return v;
}
973323
function( inoutArray ) {
		for (var i = inoutArray.length - 1; i > 0; i-- ) {
			var j = Math.floor( PNLTRI.Math.random() * (i+1) );
			var tmp = inoutArray[i];
			inoutArray[i] = inoutArray[j];
			inoutArray[j] = tmp;
		}
		return	inoutArray;
	}
913658
public function shuffle($arr)
  {
    $new = $arr;
    for ($i = count($new) - 1; $i > 0; $i--)
    {
        $j = $this->getNext(0,$i);
        $tmp = $new[$i];
        $new[$i] = $new[$j];
        $new[$j] = $tmp;
    }
    return $new;
  }
768642
public static void shuffle(Object[] a, int lo, int hi) {
    if (lo < 0 || lo > hi || hi >= a.length) {
      throw new IndexOutOfBoundsException("Illegal subarray range");
    }
    for (int i = lo; i <= hi; i++) {
      int r = i + uniform(hi - i + 1); // between i and hi
      Object temp = a[i];
      a[i] = a[r];
      a[r] = temp;
    }
  }
995531
function arraySampleSize(array, n) {
      return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
    }
1208010
public static void shuffle(byte[] byteArray) {
		int swapPlace = -1;

		for(int i = 0; i < byteArray.length; i++) {
			swapPlace = (int) (Math.random() * (byteArray.length - 1 ));
			XORSwap.swap(byteArray, i, swapPlace);
		}
	}
999144
public static void shuffle(char[] charArray) {
		int swapPlace = -1;

		for(int i = 0; i < charArray.length; i++) {
			swapPlace = (int) (Math.random() * (charArray.length - 1 ));
			XORSwap.swap(charArray, i, swapPlace);
		}
	}
714194
public static void shuffle(long[] longArray) {
		int swapPlace = -1;

		for(int i = 0; i < longArray.length; i++) {
			swapPlace = (int) (Math.random() * (longArray.length - 1 ));
			XORSwap.swap(longArray, i, swapPlace);
		}
	}
1155096
private static void shuffle(ArrayModifiableDBIDs ids, int ssize, int end, Random random) {
    ssize = ssize < end ? ssize : end; // Guard for choosing from tiny sets
    for(int i = 1; i < ssize; i++) {
      ids.swap(i - 1, i + random.nextInt(end - i));
    }
  }
1296441
def shuffle_words(s):
    ''''''
    s = s.split(' ')
    random.shuffle(s)
    s =' '.join(s)
    return s
262142
function shuffle_in_place(sample, randomSource) {

        // a custom random number source can be provided if you want to use
        // a fixed seed or another random number generator, like
        // [random-js](https://www.npmjs.org/package/random-js)
        randomSource = randomSource || Math.random;

        // store the current length of the sample to determine
        // when no elements remain to shuffle.
        var length = sample.length;

        // temporary is used to hold an item when it is being
        // swapped between indices.
        var temporary;

        // The index to swap at each stage.
        var index;

        // While there are still items to shuffle
        while (length > 0) {
            // chose a random index within the subset of the array
            // that is not yet shuffled
            index = Math.floor(randomSource() * length--);

            // store the value that we'll move temporarily
            temporary = sample[length];

            // swap the value at `sample[length]` with `sample[index]`
            sample[length] = sample[index];
            sample[index] = temporary;
        }

        return sample;
    }
150774
def shuffle(string):
    
    s = sorted(string)  # turn the string into a list of chars
    random.shuffle(s)  # shuffle the list
    return ''.join(s)
1031515
def shuffle(self, *args):
        
        call_args = list(args)
        self.random.shuffle(call_args)
        return ''.join(call_args)
868693
function baseSampleSize(collection, n) {
      var array = values(collection);
      return shuffleSelf(array, baseClamp(n, 0, array.length));
    }
749715
function randomize_options( $options ) {
		$new  = array();
		$keys = array_keys( $options );
		shuffle( $keys );

		foreach ( $keys as $key ) {
			$new[ $key ] = $options[ $key ];
		}

		return $new;
	}
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;
}
24638
function sort_mx (mx_list) {
    const sorted = mx_list.sort((a,b) => a.priority - b.priority);

    // This isn't a very good shuffle but it'll do for now.
    for (let i=0,l=sorted.length-1; i<l; i++) {
        if (sorted[i].priority === sorted[i+1].priority) {
            if (Math.round(Math.random())) { // 0 or 1
                const j = sorted[i];
                sorted[i] = sorted[i+1];
                sorted[i+1] = j;
            }
        }
    }
    return sorted;
}