Return a random integer between min and max (inclusive).
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)
764858
def do_random(context, seq):
    """"""
    try:
        return random.choice(seq)
    except IndexError:
        return context.environment.undefined('No random item, sequence was empty.')
282311
function (min, max) {
    min = typeof min !== 'undefined' ? parseInt(min, 10) : 0
    max = typeof max !== 'undefined' ? parseInt(max, 10) : 9007199254740992 // 2^53
    return Math.round(Math.random() * (max - min)) + min
  }
59745
def find_random(self, **kwargs):
        
        import random
        max = self.count(**kwargs)
        if max:
            num = random.randint(0, max - 1)
            return next(self.find(**kwargs).skip(num))
341679
def random_board(max_x, max_y, load_factor):
    """"""
    return dict(((randint(0, max_x), randint(0, max_y)), 0) for _ in
                xrange(int(max_x * max_y / load_factor)))
607475
function randomInteger(min, max) {
    if ((0, _is.isUndefined)(min)) {
        throw new Error('no arguments');
    }
    if ((0, _is.isUndefined)(max)) {
        max = min;
        min = 0;
    } else if (!(0, _is.isType)('integer', min) || !(0, _is.isType)('integer', max)) {
        throw new Error('arguments were not expected');
    }
    min = Number(min);
    max = Number(max);
    var difference = max - min;
    var random = Math.floor(Math.random() * (difference + 1));
    return min + random;
}
14744
def _min(self):
        """"""
        return (
            self.range[0] if (self.range and self.range[0] is not None) else
            (min(self._values) if self._values else None)
        )
59094
public static int randomIntBetween(int min, int max) {
    Random rand = new Random();
    return rand.nextInt((max - min) + 1) + min;
  }
463389
def random(self):
        
        minimum = self.minimum() or 0
        maximum = self.maximum() or 100
        return random.randint(minimum, maximum)
87293
public static long random(long min, long max) {
        return Math.round(ThreadLocalRandom.current().nextDouble()
                * (max - min) + min);
    }
1208270
public static int random(int min, int max) {
        if (min < 0 || max < 0) {
            throw new RuntimeException(
                    "illegal argment, min and max must great then zero.");
        }
        if (min > max) {
            int t = max;
            max = min;
            min = t;
        } else if (min == max) {
            return min;
        }

        Random random = new Random();
        return random.nextInt(max) % (max - min + 1) + min;

    }
581776
function randint(from, to) {
		return Math.round(Math.random() * (to - from) + from);
	}
40227
function (value, min, max) {
            var interval;
            if (min > max) {
                max = min + max;
                min = max - min;
                max = max - min;
            }
            interval = max - min;
            return min + ((value % interval) + interval) % interval;
        }
1207589
public static function random_int(int $min=0, int $max=1) {
		if ($min > $max) {
			static::switcheroo($min, $max);
		}

		return \random_int($min, $max);
	}
1290093
def permute(num):
    ""
    if permute_data:
        return np.random.permutation(num)
    else:
        logging.warning("Warning not permuting data")
        return np.arange(num)
431523
public static double nextDouble(Random random, final double min, final double max) {
		Validate.isTrue(max >= min, "Start value must be smaller or equal to end value.");
		MoreValidate.nonNegative("min", min);

		if (Double.compare(min, max) == 0) {
			return min;
		}

		return min + ((max - min) * random.nextDouble());
	}
1249010
public static Number random(Number min, Number max) {
		double minVal = min.doubleValue() - 1;
		double maxVal = max.doubleValue() + 1;
		double ret = Math.random() * (maxVal - minVal) + minVal;
		ret = Math.min(ret, max.doubleValue());
		ret = Math.max(ret, min.doubleValue());
		return ret;
	}