utility that returns 2d array filled with random numbers or with value s, if provided
770495
function (n, d, s) {
		var uses = typeof s !== 'undefined';
		var x = [];
		for (var i = 0; i < n; i++) {
			var xhere = [];
			for (var j = 0; j < d; j++) {
				if (uses) {
					xhere.push(s);
				} else {
					xhere.push(randn(0.0, 1e-4));
				}
			}
			x.push(xhere);
		}
		return x;
	}
537855
def generator(self, random, args):
        """"""
        if self.duplicates:
            max_count = [self.capacity // item[0] for item in self.items]
            return [random.randint(0, m) for m in max_count]
        else:
            return [random.choice([0, 1]) for _ in range(len(self.items))]
946009
def _random_x(self):
        """"""
        return (tuple(random.random() for _ in range(self.fmodel.dim_x)),)
457354
function getRandomArray (n) {
  var res = []
    , i, j, temp
    ;

  for (i = 0; i < n; i += 1) { res[i] = i; }

  for (i = n - 1; i >= 1; i -= 1) {
    j = Math.floor((i + 1) * Math.random());
    temp = res[i];
    res[i] = res[j];
    res[j] = temp;
  }

  return res;
}
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
791019
function randomDigits(len) {
  var str = Math.random().toString() + Array(len + 1).join('0');
  return str.substr(2, len);
}
356521
def _random_fill(self):
        """"""
        a = self._array
        for p, tile in self.positions_with_tile():
            if tile.is_blank():
                a[p] = Tile.random_tile()
1180963
def _sample(rng, arr, k):
  
  selected = numpy.empty(k, dtype="uint32")
  rng.sample(numpy.asarray(arr, dtype="uint32"),
             selected)
  return selected
428224
function getRandomColors() {
    var letters = '0123456789ABCDEF'.split('');
    var _color = '#';
    for (var i = 0; i < 6; i++) {
        _color += letters[Math.floor(Math.random() * 16)];
    }
    return _color;
}
452843
def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]:
    
    while True:
        yield "".join([choice(chars) for _ in range(length)])
612686
function createRandom(n, min, max) {
    let scale = max - min;
    let array = [];
    for (var i = 0; i < n; i++) {
        array[i] = (Math.random() * scale) + min;
    }
    return new Vector(array);
}
522397
function randomString (length) {
    length = length || 6;

    var result = [],
        i;

    for (i = 0; i < length; i++) {
        result[i] = ASCII_SOURCE[(Math.random() * ASCII_SOURCE_LENGTH) | 0];
    }

    return result.join(EMPTY);
}
527985
function shuffleArray(array){
    var length = array.length;
    var randomIndex;
    var currentIndex = 0;
    var tmp;
    for (; currentIndex < length; currentIndex++) {
        randomIndex = Math.floor(Math.random() * length);
        tmp = array[currentIndex];
        array[currentIndex] = array[randomIndex];
        array[randomIndex] = tmp;
    }
    return array;
}
994971
function shuffleArray (options, arr) {
    if (!options.minify) { return undefined; }

    for (let i = 0, max = arr.length; i < max; i++) {
        let j = randomInt(max);

        if (arr[j] !== arr[i]) {
            let source = arr[i];

            arr[i] = arr[j];
            arr[j] = source;
        }
    }
}
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;
}
391389
def randomArray(size, bound):
    
    if type(size) == type(1):
        size = (size,)
    temp = Numeric.array( ndim(*size) ) * (2.0 * bound)
    return temp - bound
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
}