<commit_before>//Patterns For Large-Scale JavaScript Application Architecture

var mediator=function(){
  var subscribe=function(channel,fn){
    if(!mediator.channels[channel]) mediator.channels[channel]=[];
    mediator.channels[channel].push({context:this,callback:fn});
    return this;
  };

  var publish=function(channel){
    if(!mediator.channels[channel]) return false;
    var args=Array.prototype.slice(arguments,1);
    for(var i=0,ii=mediator.channels[channel].length;i<ii;i++){
      var subscription=mediator.channels[channel][i];
      var callback=subscription.callback;
      callback.apply(subscription.context,args);
    }
    return this;
  };

  return {
    channels:{},
    subscribe:subscribe,
    publish:publish,
    installTo:function(obj){
      obj.subscribe=subscribe;
      obj.publish=publish;
    }
  };
  
}();<commit_msg>Fix a typo<commit_after>//Patterns For Large-Scale JavaScript Application Architecture

var mediator=function(){
  var subscribe=function(channel,fn){
    if(!mediator.channels[channel]) mediator.channels[channel]=[];
    mediator.channels[channel].push({context:this,callback:fn});
    return this;
  };

  var publish=function(channel){
    if(!mediator.channels[channel]) return false;
    var args=Array.prototype.slice(arguments,1);
    for(var i=0,ii=mediator.channels[channel].length;i<ii;i++){
      var subscription=mediator.channels[channel][i];
      var callback=subscription.callback;
      subscription.callback.apply(subscription.context,args);
    }
    return this;
  };

  return {
    channels:{},
    subscribe:subscribe,
    publish:publish,
    installTo:function(obj){
      obj.subscribe=subscribe;
      obj.publish=publish;
    }
  };
  
}();
{'fraction_non_alphanumeric': 0.14194669756662803, 'fraction_numerical': 0.002317497103128621, 'mean_word_length': 4.265243902439025, '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': '176407', 'n_tokens_mistral': 516, 'n_tokens_neox': 508, 'n_words': 78}