<commit_before>/*!
 * jQuery Event Combinators
 * 
 * Copyright (c) 2010, <NAME>
 * Released under BSD license, see LICENSE file.
 */

(function ()
{
  jQuery.fn.whenAll = function()
  {
    var self = this;

    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm].call(self, key, data, type[key], fn);
      
          return self;
        }
        
        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        var ln = self.length; // Calculate .length at time of .bind call
  
        var args = [];
        self.each(function (i, o)
        {
          originalFn.call($(o), type, data, function ()
          {
            args[i] = arguments;
            
            for (var j = 0; j < ln; j++)
              if (!args[j])
                return;
  
            fn.apply(self, transpose(args));
            args = [];
          });
        });

        return self;
      };
    });

    return this;
  };


  jQuery.fn.whenAny = function()
  {
    var self = this;

    var originalOne = this.one;
    this.one = function(type, data, fn)
    {
      if (typeof type === "object")
      {
        for (var key in type)
          self[nm].call(self, key, data, type[key], fn);

        return self;
      }

      if (jQuery.isFunction(data) || data === false)
      {
        fn = data;
        data = undefined;
      }

      var handler = function (e)
      {
        self.unbind(e, handler);
        return fn.apply(self, arguments);
      }

      originalOne.call(this, type, data, handler);

      return self;
    };

    return this;
  };


  jQuery.fn.ignoreUntil = function(sel, outerType)
  {
    if (typeof sel == "string")
    {
      outerType = sel;
      sel = this;
    }

    var self = this;

    var originalOne = this.one;
    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm].call(self, key, data, type[key], fn);

          return self;
        }

        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        originalOne.call(sel, outerType, function ()
        {
          originalFn.call(self, type, data, fn);
        });

        return self;
      };
    });

    return this;
  };


  jQuery.fn.ignoreAfter = function(sel, outerType)
  {
    if (typeof sel == "string")
    {
      outerType = sel;
      sel = this;
    }

    var self = this;

    var originalOne = this.one;
    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm].call(self, key, data, type[key], fn);

          return self;
        }

        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        originalOne.call(sel, outerType, function ()
        {
          self.unbind(type, fn);
        });

        originalFn.call(self, type, data, fn);

        return self;
      };
    });

    return this;
  };


  jQuery.each(["bind", "one"], function (_, nm)
  {
    var originalFn = jQuery.fn[nm];
    jQuery.fn[nm + "All"] = function(types, data, fn)
    {
      if (!jQuery.isArray(types) && typeof types === "object")
      {
        for (var key in types)
          this[nm + "All"].call(this, key, data, types[key], fn);

        return this;
      }

      if (jQuery.isFunction(data) || data === false)
      {
        fn = data;
        data = undefined;
      }

      var self = this;
      var ln = types.length;
      var args = [];
<commit_msg>cleanup code.<commit_after>/*!
 * jQuery Event Combinators
 * 
 * Copyright (c) 2010, <NAME>
 * Released under BSD license, see LICENSE file.
 */

(function ()
{
  jQuery.fn.whenAll = function()
  {
    var self = this;

    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm](key, data, type[key], fn);

          return self;
        }
        
        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        var ln = self.length; // Calculate .length at time of .bind call
  
        var args = [];
        self.each(function (i, o)
        {
          originalFn.call($(o), type, data, function ()
          {
            args[i] = arguments;
            
            for (var j = 0; j < ln; j++)
              if (!args[j])
                return;
  
            fn.apply(self, transpose(args));
            args = [];
          });
        });

        return self;
      };
    });

    return this;
  };


  jQuery.fn.whenAny = function()
  {
    var self = this;

    var originalOne = this.one;
    this.one = function(type, data, fn)
    {
      if (typeof type === "object")
      {
        for (var key in type)
          this.one(key, data, type[key], fn);

        return self;
      }

      if (jQuery.isFunction(data) || data === false)
      {
        fn = data;
        data = undefined;
      }

      var handler = function (e)
      {
        self.unbind(e, handler);
        return fn.apply(self, arguments);
      }

      originalOne.call(this, type, data, handler);

      return self;
    };

    return this;
  };


  jQuery.fn.ignoreUntil = function(sel, outerType)
  {
    if (typeof sel == "string")
    {
      outerType = sel;
      sel = this;
    }

    var self = this;

    var originalOne = this.one;
    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm](key, data, type[key], fn);

          return self;
        }

        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        originalOne.call(sel, outerType, function ()
        {
          originalFn.call(self, type, data, fn);
        });

        return self;
      };
    });

    return this;
  };


  jQuery.fn.ignoreAfter = function(sel, outerType)
  {
    if (typeof sel == "string")
    {
      outerType = sel;
      sel = this;
    }

    var self = this;

    var originalOne = this.one;
    jQuery.each(["bind", "one"], function (_, nm)
    {
      var originalFn = self[nm];
      self[nm] = function(type, data, fn)
      {
        if (typeof type === "object")
        {
          for (var key in type)
            self[nm](key, data, type[key], fn);

          return self;
        }

        if (jQuery.isFunction(data) || data === false)
        {
          fn = data;
          data = undefined;
        }

        originalOne.call(sel, outerType, function ()
        {
          self.unbind(type, fn);
        });

        originalFn.call(self, type, data, fn);

        return self;
      };
    });

    return this;
  };


  jQuery.each(["bind", "one"], function (_, nm)
  {
    var originalFn = jQuery.fn[nm];
    jQuery.fn[nm + "All"] = function(types, data, fn)
    {
      if (jQuery.isFunction(data) || data === false)
      {
        fn = data;
        data = undefined;
      }

      var self = this;
      var ln = types.length;
      var args = [];

{'fraction_non_alphanumeric': 0.14333205472445978, 'fraction_numerical': 0.0012786088735455823, 'mean_word_length': 1.4934650940388907, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3690446', 'n_tokens_mistral': 2499, 'n_tokens_neox': 2396, 'n_words': 621}