<commit_before>/**
 *  Events
 */
function Events() {
  var events = {}, slice = Array.prototype.slice;
  return {
    on: function (type, func, context) {
      var list = events[type] || (events[type] = []);
      list.push({f:func, context:context});
    },
    off: function (type, func) {
      var list = events[type], copy = slice.call(events[type]), i, j;
      if(!func) return delete events[type];
      for (i=0, j=list.length; i<j; i++) {
        with(list[i]) {
          if(func === f) copy.splice(i, 1);
        }
      } 
      events[type] = copy;
    },
    emit: function (type, args) {
      if(!events[type]) return false;
      if(args && !(args instanceof Array)) args = [args];
      var list = events[type], i, j;
      for(i=0, j=list.length; i<j; i++){
        list[i].f.apply(list[i].context, args);
      }
    }
  }<commit_msg>added shared variables for loops and multiple access<commit_after>/**
 *  Events
 */
function Events(){
  var events = {}, i, list, args, A = Array;
  return {
    on: function (type, func, context) {
      var list = events[type] || (events[type] = []);
      list.push({f:func, context:context});
    },
    off: function (type, func) {
      var list = events[type], copy = slice.call(events[type]), i, j;
      if(!func) return delete events[type];
      for (i=0, j=list.length; i<j; i++) {
        with(list[i]) {
          if(func === f) copy.splice(i, 1);
        }
      } 
      events[type] = copy;
    },
    emit: function (type, args) {
      if(!events[type]) return false;
      if(args && !(args instanceof Array)) args = [args];
      var list = events[type], i, j;
      for(i=0, j=list.length; i<j; i++){
        list[i].f.apply(list[i].context, args);
      }
    }
  }
{'fraction_non_alphanumeric': 0.18832283915283343, 'fraction_numerical': 0.0034344590726960505, 'mean_word_length': 2.4140625, 'pattern_counts': {'":': 0, '<': 7, '<?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': '552414', 'n_tokens_mistral': 603, 'n_tokens_neox': 599, 'n_words': 152}