<commit_before>/*--------------------------------------------*
 * Useful extensions when
 * you are creating your own
 * javascript objects/classes
 *--------------------------------------------*
 * Orgins from:
 * Simple JavaScript Inheritance and makeClass
 * by <NAME> http://ejohn.org/
 *--------------------------------------------*
 * Integrated with jQuery and added
 * functionality by <NAME>
 *--------------------------------------------*
 * Last Update: 2011-01-31 00:44:34
 *--------------------------------------------*/
(function( $ ) {

var initializing = false,

prefix = "jQuery.Class :: ",

// This 'ID' key will be set to 'unique' on all classes
// created by this plugin so the plugin can 
// identify the classes in an easy way
ID = "__is_class__",
unique = prefix + $.now(),

_searchable = (/\b_parent\b/).test(function(){this._parent();}),
fnSearch = _searchable ? (/\b_parent\b/) : /.*/,
parentFnSearch = _searchable ? (/\b_parent\b\./) : /.*/,

FUNCTION = "function",
OBJECT = "object",
BOOLEAN = "boolean",

/**
 * makeClass - By <NAME> (MIT Licensed)
 * http://ejohn.org/
 *
 * Makes it possible to instantiate a
 * class both with or without the new keyword.
 * It also moves the constructor to a function
 * on the prototype called "init"
 *
 * @return <function Class>
 */
makeClass = function(){
    function Class( args ) {
        if ( this instanceof Class ) {
            // If not executing the "extend" function and an init method exist
            if ( ! initializing && typeof this.init === FUNCTION ) {
                // Call the "real" constructor and apply the arguments
                this.init.apply( this, (typeof args === OBJECT && args.callee) ? args : arguments );
            }
        } else {
            // Instantiate the class and pass the aruments
            return new Class( arguments );
        }
    }

    Class[ID] = unique;

    return Class;
},

/**
 * The base Class implementation (does nothing) and some base functions
 */
Base = $.extend( makeClass(), {

    /**
     * Makes it possible to extend objects
     */
    extend: function( setStatic, prop ) {

        // Create a new class
        var Class = makeClass(), name, populator;

        if ( typeof setStatic !== BOOLEAN ) {
            prop = setStatic;
        }
        
        prop = typeof prop === OBJECT && prop !== null ? prop : {};

        // Add functions
        for ( name in this ) {
            if( this.hasOwnProperty(name) ) {
                Class[name] = this[name];
            }
        }

        if ( setStatic === true || typeof prop.prototype === OBJECT ) {
            populator = $.Class.initPopulator(this);
            $.Class.validate(prop);
            for ( name in prop ) {
                if( prop.hasOwnProperty(name) && name !== "prototype" ) {
                    Class[name] = $.Class.rewrite(name, prop, this, populator);
                }
            }
            prop = prop.prototype;
        }

        // Enforce the constructor to be what we expect
        Class.constructor = Class;

        // Populate our constructed prototype object
        $.Class.addMethods( this, prop, Class );

        return Class;
    },

    /**
     * An alias for the $.Class.addMethods method
     * to be able to add methods to a class with a nice syntax
     */
    addMethods: function( prop ) {
        return $.Class.addMethods( this, prop );
    }

});

/**
 * Simple JavaScript Inheritance
 * By <NAME> http://ejohn.org/
 * MIT Licensed.
 * @param <object> prop: The prototype that you want the object to have<commit_msg>added extending possibilites to already initalized objects<commit_after>/*--------------------------------------------*
 * Useful extensions when
 * you are creating your own
 * javascript objects/classes
 *--------------------------------------------*
 * Orgins from:
 * Simple JavaScript Inheritance and makeClass
 * by <NAME> http://ejohn.org/
 *--------------------------------------------*
 * Integrated with jQuery and added
 * functionality by <NAME>
 *--------------------------------------------*
 * Last Update: 2011-02-25 16:11:23
 *--------------------------------------------*/
(function( $ ) {

var initializing = false,

prefix = "jQuery.Class :: ",

// This 'ID' key will be set to 'unique' on all classes
// created by this plugin so the plugin can 
// identify the classes in an easy way
ID = "__is_class__",
unique = prefix + $.now(),

_searchable = (/\b_parent\b/).test(function(){this._parent();}),
fnSearch = _searchable ? (/\b_parent\b/) : /.*/,
parentFnSearch = _searchable ? (/\b_parent\b\./) : /.*/,

FUNCTION = "function",
OBJECT = "object",
BOOLEAN = "boolean",

/**
 * makeClass - By <NAME> (MIT Licensed)
 * http://ejohn.org/
 *
 * Makes it possible to instantiate a
 * class both with or without the new keyword.
 * It also moves the constructor to a function
 * on the prototype called "init"
 *
 * @return <function Class>
 */
makeClass = function(){
    function Class( args ) {
        if ( this instanceof Class ) {
            // If not executing the "extend" function and an init method exist
            if ( ! initializing && typeof this.init === FUNCTION ) {
                // Call the "real" constructor and apply the arguments
                this.init.apply( this, (typeof args === OBJECT && args.callee) ? args : arguments );
            }
        } else {
            // Instantiate the class and pass the aruments
            return new Class( arguments );
        }
    }

    Class[ID] = unique;

    return Class;
},

/**
 * The base Class implementation (does nothing) and some base functions
 */
Base = $.extend( makeClass(), {

    /**
     * Makes it possible to extend objects
     */
    extend: function( setStatic, prop ) {

        // Create a new class
        var Class = makeClass(), name, populator;

        if ( typeof setStatic !== BOOLEAN ) {
            prop = setStatic;
        }
        
        prop = typeof prop === OBJECT && prop !== null ? prop : {};

        // Add functions
        for ( name in this ) {
            if( this.hasOwnProperty(name) ) {
                Class[name] = this[name];
            }
        }

        if ( setStatic === true || typeof prop.prototype === OBJECT ) {
            populator = $.Class.initPopulator(this);
            $.Class.validate(prop);
            for ( name in prop ) {
                if( prop.hasOwnProperty(name) && name !== "prototype" ) {
                    Class[name] = $.Class.rewrite(name, prop, this, populator);
                }
            }
            prop = prop.prototype;
        }

        // Enforce the constructor to be what we expect
        Class.constructor = Class;

        // Populate our constructed prototype object
        $.Class.addMethods( this, prop, Class );

        return Class;
    },

    /**
     * An alias for the $.Class.addMethods method
     * to be able to add methods to a class with a nice syntax
     */
    addMethods: function( prop ) {
        return $.Class.addMethods( this, prop );
    }

});

Base.prototype = {

    /**
     * A default function on all classes that are created.
     *
     * Makes in possible to extend already initalized
     * objects in an easy way
     */
    extend: function(prop) {
        var self = this, populator = $.Class.initPopulator(self);
        for ( var name in prop ) {
            if( prop.hasOwnProperty(name) ) {
                self[name] = $.Class.rewrite( name, prop, self, populator );
            }
        }
        return self;
    }

};

/**
 * Simple JavaScript Inheritance
 * By <NAME> http://ejohn.org/
 * MIT Licensed.
 * @param <object> prop: The prototype that you want the object to have
{'fraction_non_alphanumeric': 0.17409904070521132, 'fraction_numerical': 0.003629764065335753, 'mean_word_length': 1.724223163841808, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6224568', 'n_tokens_mistral': 2087, 'n_tokens_neox': 2006, 'n_words': 695}