<commit_before>(function ($) {
    var slice = Array.prototype.slice;
    $.defer = function (func, delay) {
        var args = slice.call(arguments, 2),
            isCancelled = false,
            cancel = function (reject /* = true */) {
                clearTimeout(timerId);
                isCancelled = true;
                if ((!arguments.length || reject) && deferred.state() === "pending") {
                    deferred.reject(null, promise, args);
                }
            },
            deferred = $.Deferred(),
            timerId = setTimeout(function () {
                deferred.notify(promise, args);
                if (isCancelled) {
                    return;
                }
                try {
                    var result = func.apply(this, args);
                    deferred.resolve(result, promise, args);
                } catch (e) {
                    deferred.reject(e, promise, args);
                }
            }, delay),
            promise = deferred.promise();

        promise.cancel = cancel;
        return promise;
    };
})(jQuery);<commit_msg>All parameters are optional<commit_after>;(function ($, undefined) {
    var slice = Array.prototype.slice;
    $.defer = function ( /*[func] [, delay] [, funcParameters]*/ ) {
        var args = arguments,
            isFunc = $.isFunction(args[0]),
            func = isFunc ? args[0] : $.noop,
            delay = (isFunc ? args[1] : args[0]) || 0,
            funcArgs = isFunc ? slice.call(args, 2) : undefined,
            isCancelled = false,
            cancel = function (reject /* = true */ ) {
                clearTimeout(timerId);
                isCancelled = true;
                if ((!arguments.length || reject) && deferred.state() === "pending") {
                    deferred.reject(null, promise, funcArgs);
                }
            },
            deferred = $.Deferred(),
            timerId = setTimeout(function () {
                deferred.notify(promise, funcArgs);
                if (isCancelled) {
                    return;
                }
                try {
                    var result = func.apply(this, funcArgs);
                    deferred.resolve(result, promise, funcArgs);
                } catch (e) {
                    deferred.reject(e, promise, funcArgs);
                }
            }, delay),
            promise = $.extend(deferred.promise(), {
                cancel: cancel
            });
        return promise;
    };
})(jQuery);
{'fraction_non_alphanumeric': 0.12709832134292565, 'fraction_numerical': 0.002797761790567546, 'mean_word_length': 1.3026678932842686, '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': '1262303', 'n_tokens_mistral': 656, 'n_tokens_neox': 619, 'n_words': 137}