<commit_before>/* eslint-env node, browser */
var KeyEvent = function(data, type) {
    this.keyCode = 'keyCode' in data ? data.keyCode : 0;
    this.charCode = 'charCode' in data ? data.charCode : 0;

    var modifiers = 'modifiers' in data ? data.modifiers : [];

    this.ctrlKey = false;
    this.metaKey = false;
    this.altKey = false;
    this.shiftKey = false;

    for (var i = 0; i < modifiers.length; i++) {
        this[modifiers[i] + 'Key'] = true;
    }

    this.type = type || 'keypress';
};

KeyEvent.prototype.toNative = function() {
    var event = document.createEventObject ? document.createEventObject() : document.createEvent('Events');

    if (event.initEvent) {
        event.initEvent(this.type, true, true);
    }

    event.keyCode = this.keyCode;
    event.which = this.charCode || this.keyCode;
    event.shiftKey = this.shiftKey;
    event.metaKey = this.metaKey;
    event.altKey = this.altKey;
    event.ctrlKey = this.ctrlKey;

    return event;<commit_msg>Fix key-event helper for IE9 & IE10<commit_after>/* eslint-env node, browser */
var KeyEvent = function(data, type) {
    this.keyCode = 'keyCode' in data ? data.keyCode : 0;
    this.charCode = 'charCode' in data ? data.charCode : 0;

    var modifiers = 'modifiers' in data ? data.modifiers : [];

    this.ctrlKey = false;
    this.metaKey = false;
    this.altKey = false;
    this.shiftKey = false;

    for (var i = 0; i < modifiers.length; i++) {
        this[modifiers[i] + 'Key'] = true;
    }

    this.type = type || 'keypress';
};

KeyEvent.prototype.toNative = function() {
    var event = document.createEvent ? document.createEvent("Event") : document.createEventObject();

    if (event.initEvent) {
        event.initEvent(this.type, true, true);
    }

    event.keyCode = this.keyCode;
    event.which = this.charCode || this.keyCode;
    event.shiftKey = this.shiftKey;
    event.metaKey = this.metaKey;
    event.altKey = this.altKey;
    event.ctrlKey = this.ctrlKey;

    return event;
{'fraction_non_alphanumeric': 0.13993003498250875, 'fraction_numerical': 0.004497751124437781, 'mean_word_length': 2.91015625, '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': '1270305', 'n_tokens_mistral': 681, 'n_tokens_neox': 658, 'n_words': 152}