<commit_before>//  Chance.js 0.3.1
//  http://chancejs.com
//  (c) 2013 <NAME>
//  Chance may be freely distributed or modified under the MIT license.

(function () {

    // Constructor
    var Chance = function (seed) {
        if (seed !== undefined) {
            this.seed = seed;
        }
        this.mt = this.mersenne_twister(seed);
    };

    // Wrap the MersenneTwister
    Chance.prototype.random = function () {
        return this.mt.random(this.seed);
    };

    // -- Basics --

    Chance.prototype.bool = function () {
        return this.random() * 100 < 50;
    };

    // NOTE the max and min are INCLUDED in the range. So:
    //
    // chance.natural({min: 1, max: 3});
    //
    // would return either 1, 2, or 3.

    Chance.prototype.natural = function (options) {
        options = options || {};
        options.min = options.min || 0;
        // 9007199254740992 (2^53) is the max integer number in JavaScript
        // See: http://vq.io/132sa2j
        options.max = options.max || 9007199254740992;

        return Math.floor(this.random() * (options.max - options.min + 1) + options.min);
    };

    Chance.prototype.integer = function (options) {
        var num, range;

        options = options || {};
        options.min = (typeof options.min !== "undefined") ? options.min : -9007199254740992;
        options.max = (typeof options.max !== "undefined") ? options.max : 9007199254740992;

        // Greatest of absolute value of either max or min so we know we're
        // including the entire search domain.
        range = Math.max(Math.abs(options.min), Math.abs(options.min));

        // Probably a better way to do this...
        do {
            num = this.natural({min: 0, max: range});
            num = this.bool() ? num : num * -1;
        } while (num < options.min || num > options.max);

        return num;
    };

    Chance.prototype.character = function (options) {
        options = options || {};

        var lower = "abcdefghijklmnopqrstuvwxyz",
            upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
            numbers = "0123456789",
            symbols = "!@#$%^&*()[]",
            letters, pool;

        if (options.alpha && options.symbols) {
            throw new RangeError("Chance: Cannot specify both alpha and symbols.");
        }
<commit_msg>Fixed .integer() to calculate correct range.<commit_after>//  Chance.js 0.3.1
//  http://chancejs.com
//  (c) 2013 <NAME>
//  Chance may be freely distributed or modified under the MIT license.

(function () {

    // Constructor
    var Chance = function (seed) {
        if (seed !== undefined) {
            this.seed = seed;
        }
        this.mt = this.mersenne_twister(seed);
    };

    // Wrap the MersenneTwister
    Chance.prototype.random = function () {
        return this.mt.random(this.seed);
    };

    // -- Basics --

    Chance.prototype.bool = function () {
        return this.random() * 100 < 50;
    };

    // NOTE the max and min are INCLUDED in the range. So:
    //
    // chance.natural({min: 1, max: 3});
    //
    // would return either 1, 2, or 3.

    Chance.prototype.natural = function (options) {
        options = options || {};
        options.min = options.min || 0;
        // 9007199254740992 (2^53) is the max integer number in JavaScript
        // See: http://vq.io/132sa2j
        options.max = options.max || 9007199254740992;

        return Math.floor(this.random() * (options.max - options.min + 1) + options.min);
    };

    Chance.prototype.integer = function (options) {
        var num, range;

        options = options || {};
        options.min = (typeof options.min !== "undefined") ? options.min : -9007199254740992;
        options.max = (typeof options.max !== "undefined") ? options.max : 9007199254740992;

        // Greatest of absolute value of either max or min so we know we're
        // including the entire search domain.
        range = Math.max(Math.abs(options.min), Math.abs(options.max));

        // Probably a better way to do this...
        do {
            num = this.natural({min: 0, max: range});
            num = this.bool() ? num : num * -1;
        } while (num < options.min || num > options.max);

        return num;
    };

    Chance.prototype.character = function (options) {
        options = options || {};

        var lower = "abcdefghijklmnopqrstuvwxyz",
            upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
            numbers = "0123456789",
            symbols = "!@#$%^&*()[]",
            letters, pool;

        if (options.alpha && options.symbols) {
            throw new RangeError("Chance: Cannot specify both alpha and symbols.");
        }

{'fraction_non_alphanumeric': 0.13952493045153005, 'fraction_numerical': 0.04365503958912904, 'mean_word_length': 1.9770700636942675, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1390304', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1397, 'n_words': 383}