<commit_before>define(function() {

  "use strict";

  if (!document.addEventListener) { return false; }

  var updateClass;

  updateClass = function(deviceType) {
    var match = document.documentElement.className.match(/last-input-(\w+)/),
        oldClass = match && match[0],
        oldDevice = match && match[1];

    if (oldDevice == deviceType) { return; }

    if (match && oldClass) {
      document.documentElement.className = document.documentElement.className.replace(oldClass, "last-input-" + deviceType);
    } else {
      document.documentElement.className += " last-input-" + deviceType;
    }
  };

  document.addEventListener("mousemove", function() {
    updateClass("mouse");
  });

  document.addEventListener("touchmove", function() {
    updateClass("touch");
  });

  document.addEventListener("keyup", function() {
    updateClass("keyboard");
  });

  document.addEventListener("pointermove", function(event) {
    event.pointerType && (updateClass(event.pointerType));
  });

});<commit_msg>add events<commit_after>define(function() {

  "use strict";

  if (!document.addEventListener) { return false; }

  var first = {},
      listener = document.getElementById("js-row--content");

  function updateClass(deviceType) {
    var match = document.documentElement.className.match(/last-input-(\w+)/),
        oldClass = match && match[0],
        oldDevice = match && match[1],
        event;

    if (oldDevice == deviceType) { return; }

    if (match && oldClass) {
      document.documentElement.className = document.documentElement.className.replace(oldClass, "last-input-" + deviceType);
    } else {
      document.documentElement.className += " last-input-" + deviceType;
    }

    if (!listener || !first[deviceType]) { return; }

    first[deviceType] = true;

    event = document.createEvent("CustomEvent");
    event.initCustomEvent(":device/" + deviceType);
    listener.dispatchEvent(event);
  }

  document.addEventListener("mousemove", function() {
    updateClass("mouse");
  });

  document.addEventListener("touchmove", function() {
    updateClass("touch");
  });

  document.addEventListener("keyup", function() {
    updateClass("keyboard");
  });

  document.addEventListener("pointermove", function(event) {
    event.pointerType && updateClass(event.pointerType);
  });

});
{'fraction_non_alphanumeric': 0.1583011583011583, 'fraction_numerical': 0.001716001716001716, 'mean_word_length': 3.808247422680412, 'pattern_counts': {'":': 1, '<': 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': '1780869', 'n_tokens_mistral': 667, 'n_tokens_neox': 639, 'n_words': 111}