<commit_before>// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.


module.exports.track = function(category, action, label, prop, val) {
    global.window.snowplow('trackStructEvent', category, action, label, prop, val);
    global.window.analytics.track(action, {category: category, label: label, property: prop, value: val});
};

module.exports.trackPage = function() {
    global.window.snowplow('trackPageView');
    global.window.analytics.page();
};

function handleError(method_name, xhr, status, err) {
    var _LTracker = global.window._LTracker | [];

    var e = null;
    try {
        e = JSON.parse(xhr.responseText);
    }
    catch(parse_error) {
    }

    var msg = "";

    if (e) {
        msg = "error in " + method_name + " msg=" + e.message + " detail=" + e.detailed_error + " rid=" + e.request_id;
    }
    else {
        msg = "error in " + method_name + " status=" + status + " statusCode=" + xhr.status + " err=" + err;

        if (xhr.status === 0)
            e = { message: "There appears to be a problem with your internet connection" };
        else
            e = { message: "We received an unexpected status code from the server (" + xhr.status + ")"};
    }
<commit_msg>fix typo<commit_after>// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.


module.exports.track = function(category, action, label, prop, val) {
    global.window.snowplow('trackStructEvent', category, action, label, prop, val);
    global.window.analytics.track(action, {category: category, label: label, property: prop, value: val});
};

module.exports.trackPage = function() {
    global.window.snowplow('trackPageView');
    global.window.analytics.page();
};

function handleError(method_name, xhr, status, err) {
    var _LTracker = global.window._LTracker || [];

    var e = null;
    try {
        e = JSON.parse(xhr.responseText);
    }
    catch(parse_error) {
    }

    var msg = "";

    if (e) {
        msg = "error in " + method_name + " msg=" + e.message + " detail=" + e.detailed_error + " rid=" + e.request_id;
    }
    else {
        msg = "error in " + method_name + " status=" + status + " statusCode=" + xhr.status + " err=" + err;

        if (xhr.status === 0)
            e = { message: "There appears to be a problem with your internet connection" };
        else
            e = { message: "We received an unexpected status code from the server (" + xhr.status + ")"};
    }

{'fraction_non_alphanumeric': 0.14575059571088164, 'fraction_numerical': 0.003971405877680699, 'mean_word_length': 2.8282674772036476, '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': '6171144', 'n_tokens_mistral': 799, 'n_tokens_neox': 774, 'n_words': 215}