<commit_before>jQuery.widget( 'dormilich.request', {

    version: '0.1.0',

    options: {
        url: false,
        method: 'GET'
    },

    _setOption: function ( key, value ) {
        if ( key in this.options ) {
            this._super( key, value );
        }
    },

    _create: function () {
        this._setOptions( this.element.data() );
    }
});<commit_msg>created submit function that fires the AJAX request.<commit_after>$.widget( 'dormilich.request', {

    version: '0.1.0',

    options: {
        url: false,
        method: 'GET',
        autoSubmit: false
    },

    _create: function () {
        this._setOptions( this.element.data() );
    },

    _init: function () {
        if ( this.options.autoSubmit ) {
            this.submit();
        }
    },

    submit: function () {
        var plugin = this;

        if ( ! this.options.url ) {
            return $.Deferred( function ( dfr ) {
                dfr.reject( 'Missing required AJAX URL.' );
            } );
        }

        return $.ajax( this.options.url, {
            method: this.options.method.toUpperCase(), // jQuery >= 1.9.0
            data: this._data(),
            beforeSend: function () {
                plugin._trigger( 'submit' );
            }
        } );
    },

    _data: function () {
        var data, plugin = this;
        // unfortunately, `.dataset` is not supported by IE < 11
        // otherwise I could spare me the widget removal
        data = $.extend( {}, this.element.data() );
        // filter off the widget options
        $.each( this.options, function ( key ) {
            delete data[ key ];
        } );
        // remove the property that refers to the widget instance
        // since that interfers with events in jQuery.ajax()
        // this differs between jQuery 2 (namespace-name)
        // and jQuery 3 (namespaceName)
        $.each( data, function ( key ) {
            if ( key.indexOf( plugin.namespace ) === 0 ) {
                delete data[ key ];
            }
        } );

        return data;
    }

} );
{'fraction_non_alphanumeric': 0.1339458413926499, 'fraction_numerical': 0.006769825918762089, 'mean_word_length': 1.5448954489544895, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7182414', 'n_tokens_mistral': 596, 'n_tokens_neox': 570, 'n_words': 156}