The shuffle command
503696
async def shuffle(self):
        """"""

        self.logger.debug("shuffle command")

        if not self.state == 'ready':
            return

        self.statuslog.debug("Shuffling")

        random.shuffle(self.queue)

        self.update_queue()
        self.statuslog.debug("Shuffled")
1361447
public static void shuffle(short[] shortArray) {
		int swapPlace = -1;

		for(int i = 0; i < shortArray.length; i++) {
			swapPlace = (int) (Math.random() * (shortArray.length - 1 ));
			XORSwap.swap(shortArray, i, swapPlace);
		}
	}
1354634
def permute_data(arrays, random_state=None):
  """"""
  if any(len(a) != len(arrays[0]) for a in arrays):
    raise ValueError('All arrays must be the same length.')
  if not random_state:
    random_state = np.random
  order = random_state.permutation(len(arrays[0]))
  return [a[order] for a in arrays]
1214671
public static void shuffle (Object[] values, Random rnd)
    {
        shuffle(values, 0, values.length, rnd);
    }
1025169
public static void shuffle(int[] arr, Random rand) {
        int size = arr.length;
        for (int i = size; i > 1; i--) {
            int tmp = arr[i-1];
            int r = rand.nextInt(i);
            arr[i-1] = arr[r];
            arr[r] = tmp;
        }
    }
924975
def batch_iter(data, batch_size, num_epochs):
    """"""
    data = np.array(data)
    data_size = len(data)
    num_batches_per_epoch = int(len(data)/batch_size) + 1
    for epoch in range(num_epochs):
        # Shuffle the data at each epoch
        shuffle_indices = np.random.permutation(np.arange(data_size))
        shuffled_data = data[shuffle_indices]
        for batch_num in range(num_batches_per_epoch):
            start_index = batch_num * batch_size
            end_index = min((batch_num + 1) * batch_size, data_size)
            yield shuffled_data[start_index:end_index]
1176726
public static void shuffle(double[] bstrap, int len, Random rnd) {
    int i = len;
    while(i > 0) {
      final int r = rnd.nextInt(i);
      --i;
      // Swap
      double tmp = bstrap[r];
      bstrap[r] = bstrap[i];
      bstrap[i] = tmp;
    }
  }
230537
public static <T> void shuffle(T[] array, Random rnd) {
        //Implementing Fisher-Yates shuffle
        T tmp;
        for (int i = array.length - 1; i > 0; --i) {
            int index = rnd.nextInt(i + 1);
            
            tmp = array[index];
            array[index] = array[i];
            array[i] = tmp;
        }
    }
148395
public static void shuffle( byte []array , int offset , int length , Random rand ) {
		for (int i = 0; i < length; i++) {
			int src = rand.nextInt(length-i);
			byte tmp = array[offset+src+i];
			array[offset+src+i]=array[offset+i];
			array[offset+i] = tmp;
		}
	}
710355
private static void shuffle(int[] a) {
        Random rnd = ThreadLocalRandom.current();
        for (int i = a.length - 1; i > 0; i--) {
            int index = rnd.nextInt(i + 1);
            int e = a[index];
            a[index] = a[i];
            a[i] = e;
        }
    }
1339552
def _shuffle_single(fname, extra_fn=None):
  
  records = read_records(fname)
  random.shuffle(records)
  if extra_fn is not None:
    records = extra_fn(records)
  out_fname = fname.replace(UNSHUFFLED_SUFFIX, "")
  write_records(records, out_fname)
  tf.gfile.Remove(fname)
584500
function shuffle(sample, randomSource) {
        // slice the original array so that it is not modified
        sample = sample.slice();

        // and then shuffle that shallow-copied array, in place
        return shuffle_in_place(sample.slice(), randomSource);
    }
11821
public static <E> void shuffle(List<E> list) {
        int swapPlace = -1;
        
        for(int i = 0; i < list.size(); i++) { 
            swapPlace = (int) (Math.random() * (list.size() - 1));
            TrivialSwap.swap(list, i, swapPlace);
        }
	}
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
199809
def shuffle(args):
    
    p = OptionParser(shuffle.__doc__)
    p.set_tag()
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    p1, p2 = args
    pairsfastq = pairspf((p1, p2)) + ".fastq"
    tag = opts.tag

    p1fp = must_open(p1)
    p2fp = must_open(p2)
    pairsfw = must_open(pairsfastq, "w")
    nreads = 0
    while True:
        a = list(islice(p1fp, 4))
        if not a:
            break

        b = list(islice(p2fp, 4))
        if tag:
            name = a[0].rstrip()
            a[0] = name + "/1\n"
            b[0] = name + "/2\n"

        pairsfw.writelines(a)
        pairsfw.writelines(b)
        nreads += 2

    pairsfw.close()
    extra = nreads * 2 if tag else 0
    checkShuffleSizes(p1, p2, pairsfastq, extra=extra)

    logging.debug("File `{0}` verified after writing {1} reads.".\
                     format(pairsfastq, nreads))
    return pairsfastq
674378
def shuffle(self, times=1):
        
        for _ in xrange(times):
            random.shuffle(self.cards)
634154
public static <T> void shuffleArray(T[] arr) {
		for (int i = arr.length; i > 1; i--)
			swap(arr, i - 1, rand.nextInt(i));
	}