Returns an SArray with random integer values.
437868
def random_integers(cls, size, seed=None):
        
        if seed is None:
            seed = abs(hash("%0.20f" % time.time())) % (2 ** 31)
        return cls.from_sequence(size).hash(seed)
1000026
public double[] sample(int numSamples, Random rand)
    {
        double[] samples = new double[numSamples];
        for(int i = 0; i < samples.length; i++)
            samples[i] = invCdf(rand.nextDouble());
        
        return samples;
    }
616907
function shuffleArray(arr) {
    for (var j, x, i = arr.length; i;
      j = Math.floor(Math.random() * i),
      x = arr[--i], arr[i] = arr[j],
      arr[j] = x) {}
    return arr;
  }
1025847
function getRandomItem(list) {
    if (!list)
        return null;
    if (list.length === 0)
        return list[0];
    const randomIndex = random(1, list.length) - 1;
    return list[randomIndex];
}
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
389310
def random_like(ary=None, shape=None, dtype=None):
    
    if ary is not None:
        shape, dtype = ary.shape, ary.dtype
    elif shape is None or dtype is None:
        raise ValueError((
            'random_like(ary, shape, dtype) must be supplied '
            'with either an array argument, or the shape and dtype '
            'of the desired random array.'))

    if np.issubdtype(dtype, np.complexfloating):
        return (np.random.random(size=shape) + \
            np.random.random(size=shape)*1j).astype(dtype)
    else:
        return np.random.random(size=shape).astype(dtype)
1042221
@Override
    public INDArray randn(long rows, long columns, org.nd4j.linalg.api.rng.Random r) {
        return randn(new long[] {rows, columns}, r);
    }
1343636
function randData (o, n) {
  if (!o) {
    return ''
  }
  let a = o instanceof Array ? o : (String(o)).split('')
  let len = a.length - 1
  let str = ''
  for (let i = 0; i < n; i++) {
    str += a[tools.rnd(0, len)]
  }
  return str
}
447871
function getRandomArray (n) {
  var res, next;

  if (n === 0) { return []; }
  if (n === 1) { return [0]; }

  res = getRandomArray(n - 1);
  next = Math.floor(Math.random() * n);
  res.splice(next, 0, n - 1);   // Add n-1 at a random position in the array

  return res;
}
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;
	}
1353779
def roll(cls, num, sides, add):
        """"""
        rolls = []
        for i in range(num):
            rolls.append(random.randint(1, sides))
        rolls.append(add)
        return rolls
736457
function $rand(params) {
    if (Array.isArray(params)) {
        return params[Math.floor(Math.random() * params.length)];
    }
    throw new Error('$rand expects an array');
}
411656
function randomArray(size) {
	const cache = arrayCaches[size];
	return cache[Math.floor(Math.random() * cache.length)];
}
407326
def generateRandomSDR(numSDR, numDims, numActiveInputBits, seed=42):
  
  randomSDRs = np.zeros((numSDR, numDims), dtype=uintType)
  indices = np.array(range(numDims))
  np.random.seed(seed)
  for i in range(numSDR):
    randomIndices = np.random.permutation(indices)
    activeBits = randomIndices[:numActiveInputBits]
    randomSDRs[i, activeBits] = 1

  return randomSDRs
1371304
public static SparseMatrix random(int[] dim) {
		Random r = new Random();
		SparseMatrix matrix = new SparseMatrix(dim);
		for(int i=0;i<dim[0];i++)
			for(int j=0;j<dim[1];j++)
			{
				int []indices={i,j};
				matrix.set(indices, r.nextFloat());
			}
		return matrix;
	}
950256
public static int[] getRandomRgb() {
        int[] rgb = new int[3];
        for (int i = 0; i < 3; i++) {
            rgb[i] = random.nextInt(255);
        }
        return rgb;
    }
769771
@Override
    public INDArray rand(int[] shape, org.nd4j.linalg.api.rng.Random r) {
        INDArray ret = r.nextDouble(shape);
        return ret;
    }