<commit_before>/*
 * Simulates the penalty shootout.
 */
function Penalties(seed) {
    this.seed = seed || Math.random();

    this.goals = [0, 0];
    this.goalOrder = [[], []];
    this.turns = [5, 5];

    this.constant = 0.75
}

(function (static_, proto_) {
    
    /*
     * Main method that is called to simulate the
     * penalty shootout.
     */
    proto_.simulate = function () {
        while (true) {
            var won = false;
            var i;
            var goal;

            for (i = 0; i < 2; i += 1) {
                goal = this._takePenalty();

                this.goals[i] += goal;
                this.turns[i] -= 1;
                this.goalOrder[i].push(goal === 1);

                won = this._won();

                if (won) {
                    break;
                }
            }

            if (won) {
                break;
            }

            if (turns[0] === 0) {
                turns[0] = 1;
                turns[1] = 1;
            }
        }
    };


    /*
     * Simulates a single penalty kick.
     */
    proto_._takePenalty = function (rand) {
        rand = rand || Math.random();<commit_msg>Fixes some stuff in Penalties class<commit_after>/*
 * Simulates the penalty shootout.
 */
function Penalties(seed) {
    this.seed = seed || Math.random();

    this.goals = [0, 0];
    this.goalOrder = [[], []];
    this.turns = [5, 5];

    this.constant = 0.75
}

(function (static_, proto_) {
    
    /*
     * Main method that is called to simulate the
     * penalty shootout.
     */
    proto_.simulate = function () {
        var won = false;
        var i;
        var goal;

        while (!won) {
            for (i = 0; i < 2 && !won; i += 1) {
                goal = this._takePenalty();

                this.goals[i] += goal;
                this.turns[i] -= 1;
                this.goalOrder[i].push(goal === 1);

                won = this._won();
            }

            if (this.turns[0] === 0) {
                this.turns[0] = 1;
                this.turns[1] = 1;
            }
        }
    };


    /*
     * Simulates a single penalty kick.
     */
    proto_._takePenalty = function (rand) {
        rand = rand || Math.random();
{'fraction_non_alphanumeric': 0.14260008996851103, 'fraction_numerical': 0.016194331983805668, 'mean_word_length': 1.2173479561316052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5582401', 'n_tokens_mistral': 745, 'n_tokens_neox': 674, 'n_words': 167}