<commit_before>var utils = (function() {
  var concat = Array.prototype.concat
    , slice = Array.prototype.slice;

  return {
    // common utilities
    // ----------------

    isString: function(obj) {
      return typeof obj === 'string';
    }

  , isNumber: function(obj) {
      return typeof obj === 'number';
    }

  , isFunction: function(obj) {
      return $.isFunction(obj);
    }

  , isArray: function(obj) {
      return $.isArray(obj);
    }

  , each: function() {
      return $.each.apply($, arguments);
    }

  , map: function() {
      return $.map.apply($, arguments);
    }

  , bind: function() {
      return $.proxy.apply($, arguments);
    }

  , merge: function(array) {
      return concat.apply([], array);
    }

  , mixin: function() {
      return $.extend.apply($, arguments);
    }

    // stroke helpers
    // --------------

  , getKeyEvent: function(type, key) {
      var event = $.Event(type);

      event.which = event.keyCode = utils.isString(key) ?
        key.charCodeAt(0) : key;

      return event;
    }

  , getCursorPos: function($input) {<commit_msg>Attempt to set correctish properties on key event creation.<commit_after>var utils = (function() {
  var concat = Array.prototype.concat
    , slice = Array.prototype.slice;

  return {
    // common utilities
    // ----------------

    isString: function(obj) {
      return typeof obj === 'string';
    }

  , isNumber: function(obj) {
      return typeof obj === 'number';
    }

  , isFunction: function(obj) {
      return $.isFunction(obj);
    }

  , isArray: function(obj) {
      return $.isArray(obj);
    }

  , each: function() {
      return $.each.apply($, arguments);
    }

  , map: function() {
      return $.map.apply($, arguments);
    }

  , bind: function() {
      return $.proxy.apply($, arguments);
    }

  , merge: function(array) {
      return concat.apply([], array);
    }

  , mixin: function() {
      return $.extend.apply($, arguments);
    }

    // stroke helpers
    // --------------

  , getKeyEvent: function(type, key) {
      var event = $.Event(type);

      if (type === 'keypress') {
        event.which =
        event.keyCode =
        event.charCode = utils.isString(key) ? key.charCodeAt(0) : key;
      }

      else if (type === 'keydown' || type === 'keyup') {
        event.charCode = 0;
        event.which = event.charCode = utils.isString(key) ?
          key.toUpperCase().charCodeAt(0) : key;
      }

      else if (type === 'textInput') {
        if (!utils.isString(key)) {
          throw new TypeError('non-string passed for textInput');
        }

        event.data = key;
      }

      return event;
    }

  , getCursorPos: function($input) {
{'fraction_non_alphanumeric': 0.175303197353914, 'fraction_numerical': 0.001470047776552738, 'mean_word_length': 2.0044150110375276, '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': '6220735', 'n_tokens_mistral': 866, 'n_tokens_neox': 835, 'n_words': 185}