<commit_before>// Copyright (C) 2007 Google Inc.
//      
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// .............................................................................


// Caja adds the following common Javascript extensions to ES3

if (Array.prototype.indexOf === undefined) {
    /** 
     * Returns the first index at which the specimen is found (by
     * "===") or -1 if none.  
     */
    Array.prototype.indexOf = function(specimen) {
        var i;
        var len = this.length;
        for (var i = 0; i < length; i += 1) {
            if (this[i] === specimen) {
                return i;
            }
        }
        return -1;
    };
}

if (Array.prototype.lastIndexOf == undefined) {
    /** 
     * Returns the last index at which the specimen is found (by
     * "===") or -1 if none.  
     */
    Array.prototype.lastIndexOf = function(specimen) {
        var i;
        for (var i = this.length-1; i >= 0; i -= 1) {
            if (this[i] === specimen) {
                return i;
            }
        }
        return -1;
    };
}

if (Date.prototype.toISOString === undefined) {
    /**
     * Like the date.toJSONString() method defined in json.js, but
     * without the surrounding quotes.
     */
    Date.prototype.toISOString = function() {
        function f(n) {
            return n < 10 ? '0' + n : n;
        }
        return (this.getUTCFullYear()     + '-' +
                f(this.getUTCMonth() + 1) + '-' +
                f(this.getUTCDate())      + 'T' +
                f(this.getUTCHours())     + ':' +
                f(this.getUTCMinutes())   + ':' +
                f(this.getUTCSeconds())   + 'Z');
    };
}


// caja.js exports the following names to the Javascript global
// namespace. Caja code can only use the "caja" object. The "___"
// object is for use by code generated by the Caja translator, and by
// Javascript code (such as a powerbox) in the embedding application.

var caja;
var ___;

(function() {

    /** 
     * Like an assert that can't be turned off.
     * <p>
     * Either returns true (on success) or throws (on failure).
     * Sometimes, an informative diagnostic takes some calculation that
     * we'd rather not pay for in the typical success case. To
     * accomodate this, if complaint is a function, we'll call it
     * first to get the actual complaint. After this, if the complaint
     * is a string, we'll wrap it in a <tt>new Error(complaint)</tt>
     * before throwing it.
     */
    function require(test,complaint) {
        if (test) { return true; }
        if (typeof complaint === 'function') {
            complaint = complaint();
        }
        if (typeof complaint == 'string') {
            complaint = new Error(complaint);
        }
        throw complaint;
    }

    /**
     * requires <tt>typeof specimen === typename</tt>.
     * <p>
     * If not, throws an informative TypeError
     */
    function requireType(specimen,typename,opt_name) {
        require(typeof specimen === typename, function() {
            return new TypeError('expected ' + typename + 
                                 ' instead of ' + typeof specimen +
                                 ': ' + (opt_name||specimen));
        });
    }

    /**
     * Does str end with suffix? 
     */
    function endsWith(str,suffix) {
        requireType(str,'string');
        requireType(suffix,'string');
        var strLen = str.length;
        var sufLen = suffix.length;
        return strLen >= sufLen && 
            (str.substring(strLen-sufLen,strLen) === suffix);
    }

    var originalHOP_ = Object.prototype.hasOwnProperty;

    /**
     * <tt>hasOwnProp(obj.prop)</tt> means what
     * <tt>obj.hasOwnProperty(prop)</tt> would normally mean in an
     * unmodified Javascript system.
     */
    function hasOwnProp(obj,name) { return originalHOP_.call(obj,name); }

    /**
     * Returns the 'constructor' property of obj's prototype.
     * <p>
     * By "obj's prototype", we mean the object that obj directly
     * inherits from, not the value of its 'prototype' property. If
     * obj has a '__proto__' property, then we assume we're on a
     * platform (like Firefox) in which this reliably gives us obj's
     * prototype.
     * <p>
     * If obj is not an object or function, return undefined.
     */
    function directConstructor(obj) {
        if (obj === null) { return undefined; }
        if (typeof obj !== 'object' && typeof obj !== 'function') {
            return undefined;
        }
        // The following test will always return false in IE
        if ('__proto__' in obj) { 
	    if (obj.__proto__ === null) { return undefined; }<commit_msg>Plugged a fatal leak: access to the Function constructor.<commit_after>// Copyright (C) 2007 Google Inc.
//      
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// .............................................................................


// Caja adds the following common Javascript extensions to ES3

if (Array.prototype.indexOf === undefined) {
    /** 
     * Returns the first index at which the specimen is found (by
     * "===") or -1 if none.  
     */
    Array.prototype.indexOf = function(specimen) {
        var i;
        var len = this.length;
        for (var i = 0; i < length; i += 1) {
            if (this[i] === specimen) {
                return i;
            }
        }
        return -1;
    };
}

if (Array.prototype.lastIndexOf == undefined) {
    /** 
     * Returns the last index at which the specimen is found (by
     * "===") or -1 if none.  
     */
    Array.prototype.lastIndexOf = function(specimen) {
        var i;
        for (var i = this.length-1; i >= 0; i -= 1) {
            if (this[i] === specimen) {
                return i;
            }
        }
        return -1;
    };
}

if (Date.prototype.toISOString === undefined) {
    /**
     * Like the date.toJSONString() method defined in json.js, but
     * without the surrounding quotes.
     */
    Date.prototype.toISOString = function() {
        function f(n) {
            return n < 10 ? '0' + n : n;
        }
        return (this.getUTCFullYear()     + '-' +
                f(this.getUTCMonth() + 1) + '-' +
                f(this.getUTCDate())      + 'T' +
                f(this.getUTCHours())     + ':' +
                f(this.getUTCMinutes())   + ':' +
                f(this.getUTCSeconds())   + 'Z');
    };
}


// caja.js exports the following names to the Javascript global
// namespace. Caja code can only use the "caja" object. The "___"
// object is for use by code generated by the Caja translator, and by
// Javascript code (such as a powerbox) in the embedding application.

var caja;
var ___;

(function() {

    /** 
     * Like an assert that can't be turned off.
     * <p>
     * Either returns true (on success) or throws (on failure).
     * Sometimes, an informative diagnostic takes some calculation that
     * we'd rather not pay for in the typical success case. To
     * accomodate this, if complaint is a function, we'll call it
     * first to get the actual complaint. After this, if the complaint
     * is a string, we'll wrap it in a <tt>new Error(complaint)</tt>
     * before throwing it.
     */
    function require(test,complaint) {
        if (test) { return true; }
        if (typeof complaint === 'function') {
            complaint = complaint();
        }
        if (typeof complaint == 'string') {
            complaint = new Error(complaint);
        }
        throw complaint;
    }

    /**
     * requires <tt>typeof specimen === typename</tt>.
     * <p>
     * If not, throws an informative TypeError
     */
    function requireType(specimen,typename,opt_name) {
        require(typeof specimen === typename, function() {
            return new TypeError('expected ' + typename + 
                                 ' instead of ' + typeof specimen +
                                 ': ' + (opt_name||specimen));
        });
    }

    /**
     * Does str end with suffix? 
     */
    function endsWith(str,suffix) {
        requireType(str,'string');
        requireType(suffix,'string');
        var strLen = str.length;
        var sufLen = suffix.length;
        return strLen >= sufLen && 
            (str.substring(strLen-sufLen,strLen) === suffix);
    }

    var originalHOP_ = Object.prototype.hasOwnProperty;

    /**
     * <tt>hasOwnProp(obj.prop)</tt> means what
     * <tt>obj.hasOwnProperty(prop)</tt> would normally mean in an
     * unmodified Javascript system.
     */
    function hasOwnProp(obj,name) { return originalHOP_.call(obj,name); }

    /**
     * Returns the 'constructor' property of obj's prototype.
     * <p>
     * By "obj's prototype", we mean the object that obj directly
     * inherits from, not the value of its 'prototype' property. If
     * obj has a '__proto__' property, then we assume we're on a
     * platform (like Firefox) in which this reliably gives us obj's
     * prototype.
     * <p>
     * If obj is a function or not an object, return undefined.
     */
    function directConstructor(obj) {
        if (obj === null) { return undefined; }
        if (typeof obj !== 'object') {
	    // Note that functions thereby return undefined,
	    // so directConstructor() doesn't provide access to the
	    // forbidden Function constructor.
            return undefined;
        }
        // The following test will always return false in IE
        if ('__proto__' in obj) { 
	    if (obj.__proto__ === null) { return undefined; }
{'fraction_non_alphanumeric': 0.12955235204855842, 'fraction_numerical': 0.00417298937784522, 'mean_word_length': 1.9414225941422594, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5754259', 'n_tokens_mistral': 3003, 'n_tokens_neox': 2854, 'n_words': 1028}