<commit_before>pc.extend(pc.resources, function () {
    /**
     * @name pc.resources.ScriptResourceHandler
     * @description ResourceHandler for loading javascript files dynamically
     * Two types of javascript file can be loaded, PlayCanvas ScriptType files which must contain a call to pc.script.create() to be called when the script executes,
     * or regular javascript files, such as third-party libraries.
     * @param {pc.fw.ApplicationContext} context The context is passed into the ScriptType callbacks for use in user-scripts
     * @param {String} prefix Prefix for script urls, so that script resources can be located in a variety of places including localhost
     */
    var ScriptResourceHandler = function (context, prefix) {
        this._context = context;
        
        this._prefix = prefix || ""; // prefix for script urls, allows running from script resources on localhost
        this._queue = []; // queue of urls waiting to load
        this._pending = []; // queue of scripts which have been executed but are waiting to be instanciated
        this._loaded = {}; // Script objects that have loaded 
        this._loading = null; // script element that has been created but is waiting for script to load
                
        pc.script.bind("created", this._onScriptCreated.bind(this));
    };
    ScriptResourceHandler = ScriptResourceHandler.extendsFrom(pc.resources.ResourceHandler);
    
    /**
     * @name pc.resources.ScriptResourceHandler#load
     * @description Load a new javascript resource
     * @param {String} identifier The url of the script file to download
     * @param {Function} success The success callback
     * @param {Function} error The error callback
     * @param {Function} progress The progress callback
     * @param {Object} [options] Optional parameters 
     * @param {Number} [options.timeout] A timeout value in milliseconds before the error callback is fired if the script loading has failed, defaults to 10000
     */
    ScriptResourceHandler.prototype.load = function (identifier, success, error, progress, options) {
        options = options || {};
        options.timeout = options.timeout || 10000; // default 10 second timeout
        
        var url = new pc.URI(identifier);
        url.path = pc.path.join(this._prefix, url.path);
        url = url.toString();
        
        if(this._loaded[url]) {
            if (this._loaded[url] !== true) {
                success(this._loaded[url]);
            } else {
                // regular js script, no need to call success callback
            }
        } else {
            if (this._loading) {
                this._queue.push({
                    url: url.toString(),
                    success: success,
                    error: error,
                    progress: progress
                });
            } else {
                this._addScriptTag(url.toString(), success, error, progress);
            }
        }
        
        if(options.timeout) {
            (function () {<commit_msg>Upped script resource timeout to 60s<commit_after>pc.extend(pc.resources, function () {
    /**
     * @name pc.resources.ScriptResourceHandler
     * @description ResourceHandler for loading javascript files dynamically
     * Two types of javascript file can be loaded, PlayCanvas ScriptType files which must contain a call to pc.script.create() to be called when the script executes,
     * or regular javascript files, such as third-party libraries.
     * @param {pc.fw.ApplicationContext} context The context is passed into the ScriptType callbacks for use in user-scripts
     * @param {String} prefix Prefix for script urls, so that script resources can be located in a variety of places including localhost
     */
    var ScriptResourceHandler = function (context, prefix) {
        this._context = context;
        
        this._prefix = prefix || ""; // prefix for script urls, allows running from script resources on localhost
        this._queue = []; // queue of urls waiting to load
        this._pending = []; // queue of scripts which have been executed but are waiting to be instanciated
        this._loaded = {}; // Script objects that have loaded 
        this._loading = null; // script element that has been created but is waiting for script to load
                
        pc.script.bind("created", this._onScriptCreated.bind(this));
    };
    ScriptResourceHandler = ScriptResourceHandler.extendsFrom(pc.resources.ResourceHandler);
    
    /**
     * @name pc.resources.ScriptResourceHandler#load
     * @description Load a new javascript resource
     * @param {String} identifier The url of the script file to download
     * @param {Function} success The success callback
     * @param {Function} error The error callback
     * @param {Function} progress The progress callback
     * @param {Object} [options] Optional parameters 
     * @param {Number} [options.timeout] A timeout value in milliseconds before the error callback is fired if the script loading has failed, defaults to 10000
     */
    ScriptResourceHandler.prototype.load = function (identifier, success, error, progress, options) {
        options = options || {};
        options.timeout = options.timeout || 60000; // default 10 second timeout
        
        var url = new pc.URI(identifier);
        url.path = pc.path.join(this._prefix, url.path);
        url = url.toString();
        
        if(this._loaded[url]) {
            if (this._loaded[url] !== true) {
                success(this._loaded[url]);
            } else {
                // regular js script, no need to call success callback
            }
        } else {
            if (this._loading) {
                this._queue.push({
                    url: url.toString(),
                    success: success,
                    error: error,
                    progress: progress
                });
            } else {
                this._addScriptTag(url.toString(), success, error, progress);
            }
        }
        
        if(options.timeout) {
            (function () {
{'fraction_non_alphanumeric': 0.08732624693376942, 'fraction_numerical': 0.004251839738348324, 'mean_word_length': 2.242841993637328, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2221389', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1412, 'n_words': 545}