<commit_before>!function() {
    function xhr( base, path, type, def ) {

        //request = new ( window.XMLHttpRequest, window.ActiveXObject )( "Microsoft.XMLHTTP" ); -- jshint :-(
        var request = window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject( "Microsoft.XMLHTTP" );

        request.open( "get", path, true );
        request.send();

        request.onreadystatechange = function() {
            if ( request.readyState != 4 ) {
                return;
            }

            var data;

            if ( request.status >= 200 && request.status < 300 || request.status === 304 ) {
                data = type == "xml" ? request.responseXML : request.responseText;

                jar.filters[ type ]( data );
                def.resolve([ data ]);

                // jar.order[ type ] – we work only with one specific storage
                jar( base, jar.order[ type ] ).done(function() {
                    this.set( path, data, type );
                });

                } else {
                    def.reject();
                }
            };

        return def;
    }

    jar.load = function( path, base, type ) {
            var def = jar.Deferred();

            if ( arguments.length != 3 ) {
                type = path.split( "." ).pop();
            }
<commit_msg>Add ability to change xhr method for jar.load<commit_after>!function() {
    function xhr( base, path, type, def ) {
        var request;

        // TODO: add some tests
        if ( !jar.xhr ) {
            request = window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject( "Microsoft.XMLHTTP" );

        } else {
            request = new jar.xhr();
        }

        request.open( "get", path, true );
        request.send();

        // For IE9?
        request.onprogress = function() {};

        request.onload = request.onreadystatechange = function() {
            if ( request.readyState && request.readyState != 4 ) {
                return;
            }

            var data;

            if ( request.status === undefined || request.status >= 200 && request.status < 300 || request.status === 304 ) {
                data = type == "xml" ? request.responseXML : request.responseText;

                jar.filters[ type ]( data );
                def.resolve([ data ]);

                // jar.order[ type ] – we work only with one specific storage
                jar( base, jar.order[ type ] ).done(function() {
                    this.set( path, data, type );
                });

                } else {
                    def.reject();
                }

                request.onload = request.onreadystatechange = null;
            };

        return def;
    }

    jar.load = function( path, base, type ) {
            var def = jar.Deferred();

            if ( arguments.length != 3 ) {
                type = path.split( "." ).pop();
            }

{'fraction_non_alphanumeric': 0.12904324140279197, 'fraction_numerical': 0.007831120190670752, 'mean_word_length': 1.4062244062244063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2698152', 'n_tokens_mistral': 821, 'n_tokens_neox': 741, 'n_words': 199}