<commit_before>(function() {
  let t;
  let source;

  function makeSource() {
    if (source) {
      source.removeEventListener('put', onPut);
      source.close();
    }
    source = new EventSource('/place.events');
    source.addEventListener('put', onPut);
  }

  function onPut(evt) {
    const { data = {} } = evt;
    const json = JSON.parse(data);
    const { path, data: d } = json;
    const item = byId(path).firstElementChild.firstElementChild;
    Object.keys(d.style).forEach((k) => {
      item.style[k] = d.style[k];
    });
  }

  function start() {
    makeSource();
    t = setInterval(() => {
      makeSource();
    }, 10000);
  }

  window.addEventListener('load', start);
})();<commit_msg>Remove load listener<commit_after>(function() {
  let t;
  let source;

  function makeSource() {
    if (source) {
      source.removeEventListener('put', onPut);
      source.close();
    }
    source = new EventSource('/place.events');
    source.addEventListener('put', onPut);
  }

  function onPut(evt) {
    const { data = {} } = evt;
    const json = JSON.parse(data);
    const { path, data: d } = json;
    const item = byId(path).firstElementChild.firstElementChild;
    Object.keys(d.style).forEach((k) => {
      item.style[k] = d.style[k];
    });
  }

  function start() {
    makeSource();
    t = setInterval(() => {
      makeSource();
    }, 10000);
  }

  //window.addEventListener('load', start);
})();
{'fraction_non_alphanumeric': 0.1767571329157968, 'fraction_numerical': 0.006958942240779402, 'mean_word_length': 2.8346666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7081446', 'n_tokens_mistral': 476, 'n_tokens_neox': 461, 'n_words': 92}