<commit_before>﻿Function.prototype.InheritFrom = function (parentType) {
    this.prototype = new parentType;
    this.prototype.constructor = this;
    this.GetBaseClass = function () { return parentType; };
    return this;
};
Function.prototype.DoesInheritFrom = function (type) {
    return (new this()) instanceof type;
};
Function.prototype.Implement = function (interface) {
    var interfaceName = (new interface())._TypeName;
    for (var i in interface.prototype) {
        if (!this.prototype[i])
            this.prototype[i] = new Function("throw new NotImplementedException();");
    }
    if (this._Interfaces == null)
        this._Interfaces = new Array();
    this._Interfaces[interfaceName] = true;
    return this;
};
Function.prototype.DoesImplement = function (interface) {
    if (!this._Interfaces)
        return false;
    var interfaceName = (new interface())._TypeName;
    return this._Interfaces[interfaceName] === true;
};
Function.prototype.GetName = function () {
    if (this.___FunctionName___ != null)
        return this.___FunctionName___;
    var funcNameRegex = /function (.{1,})\(/;
    var results = (funcNameRegex).exec(this.toString());
    var name = (results && results.length > 1) ? results[1] : "";
    this.___FunctionName___ = name;
    return name;
};

String.prototype.indexOfAny = function (carr, start) {
    if (!(carr instanceof Array))
        return -1;
    if (start == null)
        start = 0;
    for (var cur = start; cur < this.length; cur++) {
        var c = this.charAt(c);
        for (var i = 0; i < carr.length; i++) {
            if (c === carr[i])
                return cur;
        }
    }
    return -1;
};

function IsDocumentReady() {
    /// <returns type="Boolean" />
    return false;
}<commit_msg>Added extensions for Array and cloning to Function/Object.<commit_after>﻿Object.prototype.Clone = function () {
    return eval(uneval(this));
};

Function.prototype.InheritFrom = function (parentType) {
    this.prototype = new parentType;
    this.prototype.constructor = this;
    this.GetBaseClass = function () { return parentType; };
    return this;
};
Function.prototype.DoesInheritFrom = function (type) {
    return (new this()) instanceof type;
};
Function.prototype.Implement = function (interface) {
    var interfaceName = (new interface())._TypeName;
    for (var i in interface.prototype) {
        if (!this.prototype[i])
            this.prototype[i] = new Function("throw new NotImplementedException();");
    }
    if (this._Interfaces == null)
        this._Interfaces = new Array();
    this._Interfaces[interfaceName] = true;
    return this;
};
Function.prototype.DoesImplement = function (interface) {
    if (!this._Interfaces)
        return false;
    var interfaceName = (new interface())._TypeName;
    return this._Interfaces[interfaceName] === true;
};
Function.prototype.GetName = function () {
    if (this.___FunctionName___ != null)
        return this.___FunctionName___;
    var funcNameRegex = /function (.{1,})\(/;
    var results = (funcNameRegex).exec(this.toString());
    var name = (results && results.length > 1) ? results[1] : "";
    this.___FunctionName___ = name;
    return name;
};
Function.prototype.Clone = function () {
    return eval(uneval(this));
};

String.prototype.indexOfAny = function (carr, start) {
    if (!(carr instanceof Array))
        return -1;
    if (start == null)
        start = 0;
    for (var cur = start; cur < this.length; cur++) {
        var c = this.charAt(c);
        for (var i = 0; i < carr.length; i++) {
            if (c === carr[i])
                return cur;
        }
    }
    return -1;
};

Array.prototype.indexOfRefObject = function (ro) {
    /// <param name="ro" type="RefObject"></param>
    /// <returns type="Number" />
    for (var i = 0; i < this.length; i++) {
        if (RefObject.RefEquals(this, ro))
            return i;
    }
    return -1;
};
Array.prototype.containsRefObject = function (ro) {
    /// <param name="ro" type="RefObject"></param>
    /// <returns type="Boolean" />
    return this.indexOfRefObject(ro) > -1;
};
Array.prototype.addDistinctRefObject = function (ro) {
    /// <param name="ro" type="RefObject"></param>
    /// <returns type="Boolean" />
    if (this.containsRefObject(ro))
        return false;
    this.push(ro);
    return true;
};
Array.prototype.removeRefObject = function (ro) {
    /// <param name="ro" type="RefObject"></param>
    var index = this.indexOfRefObject(ro);
    if (index > -1)
        this.splice(index, 1);
};

function IsDocumentReady() {
    /// <returns type="Boolean" />
    return false;
}
{'fraction_non_alphanumeric': 0.14963346269943942, 'fraction_numerical': 0.004096593359206554, 'mean_word_length': 2.8755221386800334, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 20, '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': '7249161', 'n_tokens_mistral': 1391, 'n_tokens_neox': 1382, 'n_words': 345}