<commit_before>var Request = (function (argument) {

  function Request(url, settings) {
    this._aborted   = false;
    this._jqXHR     = null;
    this._calls     = {};
    this._args      = [url, settings];
    this._deferred  = $.Deferred();
    this.readyState = 1;
  }

  var proto = Request.prototype;

  $.extend(proto, {

    // start jqXHR by calling $.ajax
    run: function() {
      var 
        deferred = this._deferred,
        methodName, argsStack, i;

      if (this._jqXHR !== null) {
        return this._jqXHR;
      }
      // clreate new jqXHR object
      this._jqXHR = $.ajax.apply($, this._args);

      this._jqXHR.done(function() {
        deferred.resolve.apply(deferred, arguments);
      });

      this._jqXHR.fail(function() {
        deferred.reject.apply(deferred, arguments);
      });
      
      // apply buffered calls 
      for (methodName in this._calls) {
        argsStack = this._calls[methodName];
        for (var i in argsStack) {
          this._jqXHR[methodName].apply(this._jqXHR, argsStack[i]);
        }
      }
<commit_msg> * fix abort error<commit_after>var Request = (function (argument) {

  function Request(url, settings) {
    this._aborted   = false;
    this._jqXHR     = null;
    this._calls     = {};
    this._args      = [url, settings];
    this._deferred  = $.Deferred();
    this.readyState = 1;
  }

  var proto = Request.prototype;

  $.extend(proto, {

    // start jqXHR by calling $.ajax
    run: function() {
      var 
        deferred = this._deferred,
        methodName, argsStack, i;

      if (this._jqXHR !== null) {
        return this._jqXHR;
      }
      // clreate new jqXHR object
      this._jqXHR = $.ajax.apply($, this._args);

      this._jqXHR.done(function() {
        deferred.resolve.apply(deferred, arguments);
      });

      this._jqXHR.fail(function() {
        deferred.reject.apply(deferred, arguments);
      });

      if (this._aborted) {
        this._jqXHR.abort(this.statusText);
      }
      
      // apply buffered calls 
      for (methodName in this._calls) {
        argsStack = this._calls[methodName];
        for (var i in argsStack) {
          this._jqXHR[methodName].apply(this._jqXHR, argsStack[i]);
        }
      }

{'fraction_non_alphanumeric': 0.13184855233853007, 'fraction_numerical': 0.0008908685968819599, 'mean_word_length': 2.014765100671141, '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': '1821712', 'n_tokens_mistral': 750, 'n_tokens_neox': 716, 'n_words': 146}