<commit_before>//  _____          _ _   _
// |  ___|        (_) | | |
// | |__ _ __ ___  _| |_| |_ ___ _ __
// |  __| '_ ` _ \| | __| __/ _ \ '__|
// | |__| | | | | | | |_| ||  __/ |
// \____/_| |_| |_|_|\__|\__\___|_|

class Emitter {

  constructor(){ this.events = {}; }

  on(evt, fn) {
    this.events[evt] = this.events[evt] || [];
    this.events[evt].push(fn);
    return this;
  }

  one(evt, fn) {
    fn._once = true;
    this.on(evt, fn);
    return this;
  }

  off(evt, fn = false) {
    fn ?
      this.events[evt].splice(this.events[evt].indexOf(fn), 1):
      delete this.events[evt];
    return this;
  }

  trigger(evt, ...args) {<commit_msg>patch emitter to allow ‘now’ arg<commit_after>//  _____          _ _   _
// |  ___|        (_) | | |
// | |__ _ __ ___  _| |_| |_ ___ _ __
// |  __| '_ ` _ \| | __| __/ _ \ '__|
// | |__| | | | | | | |_| ||  __/ |
// \____/_| |_| |_|_|\__|\__\___|_|

class Emitter {

  constructor(){ this.events = {}; }

  on(evt, fn, now = false) {
    this.events[evt] = this.events[evt] || [];
    this.events[evt].push(fn);
    if (now) fn();
    return this;
  }

  one(evt, fn, now = false) {
    fn._once = true;
    this.on(evt, fn, now);
    return this;
  }

  off(evt, fn = false) {
    fn ?
      this.events[evt].splice(this.events[evt].indexOf(fn), 1):
      delete this.events[evt];
    return this;
  }

  trigger(evt, ...args) {
{'fraction_non_alphanumeric': 0.22573687994248742, 'fraction_numerical': 0.0014378145219266715, 'mean_word_length': 1.9491525423728813, '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': '3657332', 'n_tokens_mistral': 585, 'n_tokens_neox': 587, 'n_words': 77}