<commit_before>define([
    "jquery",
    "./fsm",
    "./hold_manager",
    "./queue_manager",
    "./request_throttler"
], function (
    jQuery,
    FsmModule,
    HoldManager,
    QueueManager,
    RequestThrottler
) {
    var ApePI = function(options){
        var self = this;

        this.options = jQuery.extend({
            debug:    false,
            debounce: false
        }, options);

        this.initTransitionBus();
        this.initHoldManager();
        this.initQueueManager();

        this.onTransition(function(){
            self.handleTransition.apply(self, arguments);
        });

        if (this.options.debounce){
            this.initRequestThrottler();

            this.requestThrottler.onTransition(function(){
                self.evaluateReadiness();
            });
        }

        this.holdManager.onTransition(function(){
            self.evaluateReadiness();
        });
    };

    FsmModule(ApePI);

    jQuery.extend(ApePI.prototype, {
        initRequestThrottler: function(){
            this.requestThrottler = new RequestThrottler({
                debug: this.options.debug
            });
        },

        initHoldManager: function(){
            this.holdManager = new HoldManager({
                debug: this.options.debug
            });
        },

        initQueueManager: function(){
            this.queueManager = new QueueManager({
                debug:          this.options.debug,
                requestHandler: this.options.requestHandler<commit_msg>allow the debounce timeout to be passed into the queue manager<commit_after>define([
    "jquery",
    "./fsm",
    "./hold_manager",
    "./queue_manager",
    "./request_throttler"
], function (
    jQuery,
    FsmModule,
    HoldManager,
    QueueManager,
    RequestThrottler
) {
    var ApePI = function(options){
        var self = this;

        this.options = jQuery.extend({
            debug:    false,
            debounce: false
        }, options);

        this.initTransitionBus();
        this.initHoldManager();
        this.initQueueManager();

        this.onTransition(function(){
            self.handleTransition.apply(self, arguments);
        });

        if (this.options.debounce){
            this.initRequestThrottler();

            this.requestThrottler.onTransition(function(){
                self.evaluateReadiness();
            });
        }

        this.holdManager.onTransition(function(){
            self.evaluateReadiness();
        });
    };

    FsmModule(ApePI);

    jQuery.extend(ApePI.prototype, {
        initRequestThrottler: function(){
            this.requestThrottler = new RequestThrottler({
                debug:           this.options.debug,
                debounceTimeout: this.options.debounceTimeout
            });
        },

        initHoldManager: function(){
            this.holdManager = new HoldManager({
                debug: this.options.debug
            });
        },

        initQueueManager: function(){
            this.queueManager = new QueueManager({
                debug:          this.options.debug,
                requestHandler: this.options.requestHandler
{'fraction_non_alphanumeric': 0.11041009463722397, 'fraction_numerical': 0.0, 'mean_word_length': 1.735979292493529, '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': '5333220', 'n_tokens_mistral': 843, 'n_tokens_neox': 818, 'n_words': 137}