Random numbers utils
420908
function gaussRandom() {
  if (gaussRandom.returnV) {
    gaussRandom.returnV = false;
    return gaussRandom.vVal;
  }
  var u = 2 * Math.random() - 1;
  var v = 2 * Math.random() - 1;
  var r = u * u + v * v;
  if (r == 0 || r > 1) {
    return gaussRandom();
  }
  var c = Math.sqrt(-2 * Math.log(r) / r);
  gaussRandom.vVal = v * c; // cache this
  gaussRandom.returnV = true;
  return u * c;
}
727716
function random(min, max, float) {
  if (min === undefined) {
    return Math.random();
  }

  if (max === undefined) {
    max = min;
    min = 0;
  }

  if (max < min) {
    var tmp = max;
    max = min;
    min = tmp;
  }

  if (float) {
    var result = Math.random() * (max - min) + min;
    if (float === true) {
      return result;
    } else if (typeof float === 'number') {
      var str = result.toString();
      var index = str.indexOf('.');
      str = str.substr(0, index + 1 + float);
      if (str[str.length - 1] === '0') {
        str = str.substr(0, str.length - 1) + random(1, 9);
      }
      return parseFloat(str);
    }
  }

  return Math.floor(Math.random() * (max - min + 1) + min);
}
736457
function $rand(params) {
    if (Array.isArray(params)) {
        return params[Math.floor(Math.random() * params.length)];
    }
    throw new Error('$rand expects an array');
}
148086
def random_terms(self):
        ''''''
        return {k: v for (k, v) in self.terms.items() if v.random}
1076664
function randomNode (g) {
  var keys = Object.keys(g)
  return keys[~~(keys.length*Math.random())]
}
453403
def randbelow(num: int) -> int:
    
    if not isinstance(num, int):
        raise TypeError('number must be an integer')
    if num <= 0:
        raise ValueError('number must be greater than zero')
    if num == 1:
        return 0

    # https://github.com/python/cpython/blob/3.6/Lib/random.py#L223
    nbits = num.bit_length()    # don't use (n-1) here because n can be 1
    randnum = random_randint(nbits)    # 0 <= randnum < 2**nbits
    while randnum >= num:
        randnum = random_randint(nbits)
    return randnum
755712
function () { 
      var val = (1 + (Math.random() * (30000)) | 3); 
      if(!(val >= 10000)){
        val += (10000 * Math.floor(Math.random * 9));
      } 
      return val;
    }
178884
def random(self, max_number=None):
        
        min_number = self.obj
        if max_number is None:
            min_number = 0
            max_number = self.obj
        return random.randrange(min_number, max_number)
232753
def randints(s, e, n=1):
        
        assert e >= s, "Wrong range: [{}, {})".format(s, e)
        n = max(1, n)
        arr = [s + a % (e - s) for a in struct.unpack('<%dL' % n, os.urandom(4 * n))]
        return arr
5749
function $rands(params) {
    if (
        Array.isArray(params) &&
        params.length === 2 &&
        Array.isArray(params[0]) &&
        typeof params[1] === 'number'
    ) {
        return Array(params[1])
            .fill()
            .map(() =>
                params[0].splice(
                    Math.floor(Math.random() * params[0].length),
                    1
                )
            )[0];
    }
    throw new Error(
        '$rands expects an array of two elements of which the first must be an array and the second be a number'
    );
}
976598
def randset(self):
        
        return {
            self._map_type(int)
            for x in range(self.random.randint(3, 10))}
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];
}
513335
function () {
        var n,
            r,
            E = '',
            H = '-'; // r = result , n = numeric variable for positional checks

        // if "n" is not 9 or 14 or 19 or 24 return a random number or 4
        // if "n" is not 15 generate a random number from 0 to 15
        // `(n ^ 20 ? 16 : 4)` := unless "n" is 20, in which case a random number from 8 to 11 otherwise 4
        //
        // in other cases (if "n" is 9,14,19,24) insert "-"
        // eslint-disable-next-line curly
        for (r = n = E; n++ < 36; r += n * 51 & 52 ? (n ^ 15 ? 8 ^ rnd() * (n ^ 20 ? 16 : 4) : 4).toString(16) : H);

        return r;
    }
258779
function rand62() {
    return 0 ^ Math.random() * 2 ?
      (0 ^ Math.random() * 36).toString(36)
    : (0 ^ Math.random() * 25 + 10).toString(36).toUpperCase()
  }
902974
@Override
  public void randomize(int randomSeed) {
    Random rand = new Random(randomSeed);
    for(int j = size - 1; j > 0; j --){
      int randIndex = rand.nextInt(j);
      
      int [] tmp = data[randIndex];
      data[randIndex] = data[j];
      data[j] = tmp;
      
      int tmpl = labels[randIndex];
      labels[randIndex] = labels[j];
      labels[j] = tmpl;
      
      float tmpw = weights[randIndex];
      weights[randIndex] = weights[j];
      weights[j] = tmpw;
    }
  }
974892
function randomize( obj ) {
	var j = 0,
		i = Math.floor(Math.random() * (Object.keys(obj).length)),
		result;

	for(var property in obj) {
		if(j === i) {
			result = property;
			break;
		}

		j++;
	}

	return result;
}
357470
function rand16Num(len) {
    let result = [];
    for (let i = 0; i < len; i++) {
        result.push('0123456789abcdef'.charAt(
            Math.floor(Math.random() * 16))
        );
    }
    return result.join('');
}