<commit_before>define(
    [],
    function() {
      function bind(instance) {
        var binder = instance || {};
        var handlers = [];

        binder.on = binder.bind = function (type, fn) {
          var filter, handler;

          filter = typeof(type) === "string" ? {type: type} : type;
          handler = extend({fn: fn}, filter);
          handlers.push(handler);

          return binder;
        };

        binder.off = binder.unbind = function (type, fn) {
          var filter;

          filter = typeof(type) === "string" ? {type: type} : type;
          filter = fn === undefined ? filter : extend({fn: fn}, filter);
          remove(handlers, filter);

          return binder;
        };

        binder.trigger = function (type, params, summary) {
          var j, count = 0,
              args = [{type: type}],
              filter = typeof(type) === "string" ? {type: type} : type,
              matches = find(handlers, filter),
              wildcards = find(handlers, {type: '*'}),
              items = [].concat(matches).concat(wildcards);

          // normalize args
          if (typeof params !== 'undefined' && params !== null) {
            if (typeof params === 'string' || typeof params === 'number') {
              args.push(params);
            } else if ('length' in params) { // array
              Array.prototype.push.apply(args, params);
            }
          }

          // callback all
          for (j = 0, len = items.length; j < len; j++) {
            count++;
            ret = items[j].fn.apply(this, args);
            if (ret === false) {
              break;
            }
          }
          summary && $.isFunction(summary) && summary(count);<commit_msg>Fixed a bad bug on variable leaked to global.<commit_after>define(
    [],
    function() {
      function bind(instance) {
        var binder = instance || {};
        var handlers = [];

        binder.on = binder.bind = function (type, fn) {
          var filter, handler;

          filter = typeof(type) === "string" ? {type: type} : type;
          handler = extend({fn: fn}, filter);
          handlers.push(handler);

          return binder;
        };

        binder.off = binder.unbind = function (type, fn) {
          var filter;

          filter = typeof(type) === "string" ? {type: type} : type;
          filter = fn === undefined ? filter : extend({fn: fn}, filter);
          remove(handlers, filter);

          return binder;
        };

        binder.trigger = function (type, params, summary) {
          var j, count = 0, len,
              args = [{type: type}],
              filter = typeof(type) === "string" ? {type: type} : type,
              matches = find(handlers, filter),
              wildcards = find(handlers, {type: '*'}),
              items = [].concat(matches).concat(wildcards);

          // normalize args
          if (typeof params !== 'undefined' && params !== null) {
            if (typeof params === 'string' || typeof params === 'number') {
              args.push(params);
            } else if ('length' in params) { // array
              Array.prototype.push.apply(args, params);
            }
          }

          // callback all
          for (j = 0, len = items.length; j < len; j++) {
            count++;
            ret = items[j].fn.apply(this, args);
            if (ret === false) {
              break;
            }
          }
          summary && $.isFunction(summary) && summary(count);
{'fraction_non_alphanumeric': 0.1492109038737446, 'fraction_numerical': 0.0011477761836441894, 'mean_word_length': 1.5879732739420935, 'pattern_counts': {'":': 0, '<': 5, '<?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': '891911', 'n_tokens_mistral': 960, 'n_tokens_neox': 920, 'n_words': 258}