<commit_before>var globalObject; 

try {
    if(document.getElementById) {
        window.platoon = {};
        globalObject = window.platoon;
    }
} catch(err) {
    globalObject = exports;
}

(function(global) {
    var TestCase = function(name, setup, teardown, testFns) {
        this.name = name;
        this.setUp = setup || function(cb) { cb() };
        this.tearDown = teardown || function(cb) { cb() };
        this.testFns = testFns;
    };

    // if a test waits for >30s, we abort it.
    TestCase.TIMEOUT = 30000;

    var AssertionSet = function(name, fn, against) {
        this.name = name;
        this.fn = fn;

        this.against = against || {};
        this.pending = 0;
        this.passes = [];
        this.failures = [];
        this.errors = [];
    };

    AssertionSet.prototype.passed = function() {
      return this.failures.length === 0 && this.errors.length === 0;
    };

    AssertionSet.prototype.execute = function(callback) {
        var self = this,
            started = +new Date,
            timeout = function () {
                if(self.pending > 0) {
                  if((+new Date)-started < TestCase.TIMEOUT)
                    setTimeout(timeout, 0);
                  else {
                    self.errors.push(['timed out', [], new Error()]);
                  }
                } else {
                    callback();
                }
            };
        try {
            self.fn.apply(self.against, [self]);
        } catch(err) {
            self.errors.push(err);
        }
        setTimeout(timeout, 0);
    };

    AssertionSet.prototype.async = function(callback) {
        ++this.pending;
        var self = this,
            currentAgainst = self.against;
        return function() {
            --self.pending;
            try {
              return callback.apply(self.against, [].slice.call(arguments));
            } catch(err) {
              self.errors.push(err);
            }
        };
    };

    AssertionSet.prototype.deepEqual = function(lhs, rhs, reentrant) {
        reentrant = reentrant !== undefined;
        var lhsKeys = [],
            rhsKeys = [],
            name = null;
        for(name in lhs) if(lhs.hasOwnProperty(name)) {
            lhsKeys.push(name);
        }
        for(name in rhs) if(rhs.hasOwnProperty(name)) {
            rhsKeys.push(name);
        }
        if(rhsKeys.length !== lhsKeys.length) {
            this.failures.push(['should deep equal', [lhs, rhs], new Error()]);
        } else {
            var failureLength = this.failures.length;
            for(var i = 0, len = lhsKeys.length; i < len; ++i) {
                var lhsObject = lhs[lhsKeys[i]],
                    rhsObject = rhs[rhsKeys[i]];
                if(lhsObject == rhsObject) {
                    continue;
                } else {
                    if(lhsObject instanceof Object && rhsObject instanceof Object) {
                        arguments.callee.apply(this, [lhsObject, rhsObject, true]);
                        if(failureLength !== this.failures.length) {
                            break;
                        }
                    } else {
                        this.failures.push(['should deep equal', [lhs, rhs], new Error()]);
                        break;
                    }
                }
            }
            if(failureLength === this.failures.length && !reentrant) {
                this.passes.push(['should deep equal', [lhs, rhs], new Error()]);
            }
        }
    };

    AssertionSet.prototype.ok = function(rhs) {
        (rhs ? this.passes : this.failures).push(['should okay', [rhs], new Error()]); 
    };

    AssertionSet.prototype.fail = function(rhs) {
        (rhs ? this.failures : this.passes).push(['should fail', [rhs], new Error()]); 
    };

    AssertionSet.prototype.equal = function(lhs, rhs) {
        (rhs == lhs ? this.passes : this.failures).push(['should ==', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.notEqual = function(lhs, rhs) {
        (rhs == lhs ? this.failures : this.passes).push(['should !=', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.strictEqual = function(lhs, rhs) {
        (rhs === lhs ? this.passes : this.failures).push(['should ===', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.strictNotEqual = function(lhs, rhs) {
        (rhs === lhs ? this.failures : this.passes).push(['should !==', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.isInstance = function(lhs, class_list) {
        if(!(class_list instanceof Array)) {
            class_list = [class_list];
        }
        for(var i = 0, len = class_list.length; i < len; ++i) {
            if(lhs instanceof class_list[i]) {
                this.passes.push(['should instanceof', [lhs, class_list]]);
                return;<commit_msg>Reword 'ok' and 'fail' messages<commit_after>var globalObject; 

try {
    if(document.getElementById) {
        window.platoon = {};
        globalObject = window.platoon;
    }
} catch(err) {
    globalObject = exports;
}

(function(global) {
    var TestCase = function(name, setup, teardown, testFns) {
        this.name = name;
        this.setUp = setup || function(cb) { cb() };
        this.tearDown = teardown || function(cb) { cb() };
        this.testFns = testFns;
    };

    // if a test waits for >30s, we abort it.
    TestCase.TIMEOUT = 30000;

    var AssertionSet = function(name, fn, against) {
        this.name = name;
        this.fn = fn;

        this.against = against || {};
        this.pending = 0;
        this.passes = [];
        this.failures = [];
        this.errors = [];
    };

    AssertionSet.prototype.passed = function() {
      return this.failures.length === 0 && this.errors.length === 0;
    };

    AssertionSet.prototype.execute = function(callback) {
        var self = this,
            started = +new Date,
            timeout = function () {
                if(self.pending > 0) {
                  if((+new Date)-started < TestCase.TIMEOUT)
                    setTimeout(timeout, 0);
                  else {
                    self.errors.push(['timed out', [], new Error()]);
                  }
                } else {
                    callback();
                }
            };
        try {
            self.fn.apply(self.against, [self]);
        } catch(err) {
            self.errors.push(err);
        }
        setTimeout(timeout, 0);
    };

    AssertionSet.prototype.async = function(callback) {
        ++this.pending;
        var self = this,
            currentAgainst = self.against;
        return function() {
            --self.pending;
            try {
              return callback.apply(self.against, [].slice.call(arguments));
            } catch(err) {
              self.errors.push(err);
            }
        };
    };

    AssertionSet.prototype.deepEqual = function(lhs, rhs, reentrant) {
        reentrant = reentrant !== undefined;
        var lhsKeys = [],
            rhsKeys = [],
            name = null;
        for(name in lhs) if(lhs.hasOwnProperty(name)) {
            lhsKeys.push(name);
        }
        for(name in rhs) if(rhs.hasOwnProperty(name)) {
            rhsKeys.push(name);
        }
        if(rhsKeys.length !== lhsKeys.length) {
            this.failures.push(['should deep equal', [lhs, rhs], new Error()]);
        } else {
            var failureLength = this.failures.length;
            for(var i = 0, len = lhsKeys.length; i < len; ++i) {
                var lhsObject = lhs[lhsKeys[i]],
                    rhsObject = rhs[rhsKeys[i]];
                if(lhsObject == rhsObject) {
                    continue;
                } else {
                    if(lhsObject instanceof Object && rhsObject instanceof Object) {
                        arguments.callee.apply(this, [lhsObject, rhsObject, true]);
                        if(failureLength !== this.failures.length) {
                            break;
                        }
                    } else {
                        this.failures.push(['should deep equal', [lhs, rhs], new Error()]);
                        break;
                    }
                }
            }
            if(failureLength === this.failures.length && !reentrant) {
                this.passes.push(['should deep equal', [lhs, rhs], new Error()]);
            }
        }
    };

    AssertionSet.prototype.ok = function(rhs) {
        (rhs ? this.passes : this.failures).push(['should be truth-y', [rhs], new Error()]); 
    };

    AssertionSet.prototype.fail = function(rhs) {
        (rhs ? this.failures : this.passes).push(['should be false-y', [rhs], new Error()]); 
    };

    AssertionSet.prototype.equal = function(lhs, rhs) {
        (rhs == lhs ? this.passes : this.failures).push(['should ==', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.notEqual = function(lhs, rhs) {
        (rhs == lhs ? this.failures : this.passes).push(['should !=', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.strictEqual = function(lhs, rhs) {
        (rhs === lhs ? this.passes : this.failures).push(['should ===', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.strictNotEqual = function(lhs, rhs) {
        (rhs === lhs ? this.failures : this.passes).push(['should !==', [lhs, rhs], new Error()]);
    };

    AssertionSet.prototype.isInstance = function(lhs, class_list) {
        if(!(class_list instanceof Array)) {
            class_list = [class_list];
        }
        for(var i = 0, len = class_list.length; i < len; ++i) {
            if(lhs instanceof class_list[i]) {
                this.passes.push(['should instanceof', [lhs, class_list]]);
                return;
{'fraction_non_alphanumeric': 0.14417555373256769, 'fraction_numerical': 0.0030762920426579163, 'mean_word_length': 1.646675712347354, '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': '6386222', 'n_tokens_mistral': 2899, 'n_tokens_neox': 2808, 'n_words': 567}