<commit_before>+function ($) { "use strict";

    // AJAX CLASS DEFINITION
    // ======================

    var dismiss = '[data-ajax="true"]'
    var Ajax    = function (el) {
        $(el).on('click', dismiss, this.send)
    }

    Ajax.prototype.send = function (e) {
        var $this    = $(this)
        var method = $this.attr('data-method')
        var url = $this.attr('href') || $this.attr('action') || null
        var data = $this.attr('data-data') || null
        var onSuccess = $this.attr('data-success') || null
        var onError = $this.attr('data-error') || null

        if (!url) {
            alert('href or action attribute not found!')
            return
        }

        if (onSuccess) {
            eval('onSuccess = ' + onSuccess)
            if (!$.isFunction(onSuccess))
                onSuccess = null
        }

        if (onError) {
            eval('onError = ' + onError)
            if (!$.isFunction(onError))
                onError = null
        }

        method = method ? method.toLowerCase() : 'get'

        url = url && url.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7

        data = data && data.replace(/'/g, '"') // Fix single quote

        if (e) e.preventDefault()

        try {
            data = $.parseJSON(data)
        } catch (e) {
            alert(method.toUpperCase() + ' ' + url + '   PARSE JSON ERROR' + '\n' + data + '\n' + e);
            return
        }

        if (ajax && $.isFunction(ajax))
            ajax(method, url, data, onSuccess, onError)
        else
            alert('The ajax function not found. The jquery.ajax.js library is required.')
    }


    // ALERT PLUGIN DEFINITION
    // =======================

    var old = $.fn.ajax

    $.fn.ajax = function (option) {
        return this.each(function () {
            var $this = $(this)
            var data  = $this.data('abalt.ajax')

            if (!data) $this.data('abalt.ajax', (data = new Ajax(this)))
            if (typeof option == 'string') data[option].call($this)
        })
    }

    $.fn.ajax.Constructor = Ajax


    // ALERT NO CONFLICT
    // =================

    $.fn.ajax.noConflict = function () {
        $.fn.ajax = old
        return this
    }


    // ALERT DATA-API
    // ==============

    $(document).on('click.ajax.data-api', dismiss, Ajax.prototype.send)

}(jQuery);<commit_msg>Fixed the code style<commit_after>;(function ($) { "use strict";

    // AJAX CLASS DEFINITION
    // ======================

    var dismiss = '[data-ajax="true"]',
        Ajax = function (el) {
            $(el).on('click', dismiss, this.send)
        };

    Ajax.prototype.send = function (e) {
        var $this = $(this),
            method = $this.attr('data-method'),
            url = $this.attr('href') || $this.attr('action') || null,
            data = $this.attr('data-data') || null,
            onSuccess = $this.attr('data-success') || null,
            onError = $this.attr('data-error') || null;

        if (!url) {
            alert('href or action attribute not found!');
            return
        }

        if (onSuccess) {
            eval('onSuccess = ' + onSuccess);
            if (!$.isFunction(onSuccess))
                onSuccess = null
        }

        if (onError) {
            eval('onError = ' + onError);
            if (!$.isFunction(onError))
                onError = null
        }

        method = method ? method.toLowerCase() : 'get';

        url = url && url.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7

        data = data && data.replace(/'/g, '"'); // Fix single quote

        if (e) e.preventDefault();

        try {
            data = $.parseJSON(data)
        } catch (e) {
            alert(method.toUpperCase() + ' ' + url + '   PARSE JSON ERROR' + '\n' + data + '\n' + e);
            return
        }

        if (ajax && $.isFunction(ajax))
            ajax(method, url, data, onSuccess, onError);
        else
            alert('The ajax function not found. The jquery.ajax.js library is required.')
    };


    // ALERT PLUGIN DEFINITION
    // =======================

    var old = $.fn.ajax;

    $.fn.ajax = function (option) {
        return this.each(function () {
            var $this = $(this),
                data  = $this.data('abalt.ajax');

            if (!data) $this.data('abalt.ajax', (data = new Ajax(this)));
            if (typeof option == 'string') data[option].call($this)
        })
    };

    $.fn.ajax.Constructor = Ajax;


    // ALERT NO CONFLICT
    // =================

    $.fn.ajax.noConflict = function () {
        $.fn.ajax = old;
        return this
    };


    // ALERT DATA-API
    // ==============

    $(document).on('click.ajax.data-api', dismiss, Ajax.prototype.send)

})(jQuery);
{'fraction_non_alphanumeric': 0.19432773109243698, 'fraction_numerical': 0.0004201680672268908, 'mean_word_length': 1.6974504249291784, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1081836', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1389, 'n_words': 325}