<commit_before>
define([], function() {
    'use strict';

    return withAsyncQueue;

    function withAsyncQueue() {

        this.before('initialize', function() {
            var self = this,
                deferreds = {},
                stacks = {};

            this.setupAsyncQueue = function(name) {

                var stack = stacks[name] = [],
                    objectData;

                self[name + 'Ready'] = function(callback) {
                    if (callback) {
                        // Legacy non-promise
                        if (objectData) {
                            callback.call(self, objectData);
                        } else {
                            stack.push(callback);
                        }
                    } else {
                        return deferreds[name] || (deferreds[name] = $.Deferred());
                    }
                };

                self[name + 'IsReady'] = function() {
                    if (deferreds[name]) {
                        return deferreds[name].isResolved();
                    }

                    return objectData !== undefined;
                };

                self[name + 'MarkReady'] = function(data) {
                    if (!data) throw "No object passed to " + name + "MarkReady";<commit_msg>Fix error from removed api after upgrading jquery<commit_after>
define([], function() {
    'use strict';

    return withAsyncQueue;

    function withAsyncQueue() {

        this.before('initialize', function() {
            var self = this,
                deferreds = {},
                stacks = {};

            this.setupAsyncQueue = function(name) {

                var stack = stacks[name] = [],
                    objectData;

                self[name + 'Ready'] = function(callback) {
                    if (callback) {
                        // Legacy non-promise
                        if (objectData) {
                            callback.call(self, objectData);
                        } else {
                            stack.push(callback);
                        }
                    } else {
                        return deferreds[name] || (deferreds[name] = $.Deferred());
                    }
                };

                self[name + 'IsReady'] = function() {
                    if (deferreds[name]) {
                        return deferreds[name].state() == 'resolved';
                    }

                    return objectData !== undefined;
                };

                self[name + 'MarkReady'] = function(data) {
                    if (!data) throw "No object passed to " + name + "MarkReady";
{'fraction_non_alphanumeric': 0.10906355772846935, 'fraction_numerical': 0.0, 'mean_word_length': 1.0243531202435312, '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': '3015919', 'n_tokens_mistral': 647, 'n_tokens_neox': 573, 'n_words': 131}