<commit_before>(function($) {

    var SweetTooth = window.SweetTooth = {};
    var state = SweetTooth.State = {
        ENABLED: 1,
        DISABLED: 2,
        ERROR: 3,
        OUT_OF_DATE: 4,
        UNINSTALLED: 5 // Dummy state.
    };

    var HOST = "http://localhost:16269/";
    var http = SweetTooth.LocalHTTP = { hasLocal: false };

    $(document).ajaxError(function(_, __, ___, exc) {
        if (window.console && window.console.log)
            window.console.log("AJAX: " + exc);
    });

    $.ajax({ url: HOST,
             async: false,
             cache: false,
             success: function() { http.hasLocal = true; }});

    http.ListExtensions = function() {
        return $.ajax({ url: HOST + "list",
                        dataType: "json",
                        cache: false });
    };

    http.GetExtensionInfo = function() {
        return $.ajax({ url: HOST + "info",
                        dataType: "json",
                        data: {uuid: uuid},
                        cache: false });<commit_msg>Use console.error instead of console.log for AJAX errors.<commit_after>(function($) {

    var SweetTooth = window.SweetTooth = {};
    var state = SweetTooth.State = {
        ENABLED: 1,
        DISABLED: 2,
        ERROR: 3,
        OUT_OF_DATE: 4,
        UNINSTALLED: 5 // Dummy state.
    };

    var HOST = "http://localhost:16269/";
    var http = SweetTooth.LocalHTTP = { hasLocal: false };

    $(document).ajaxError(function(_, __, ___, exc) {
        if (window.console && window.console.error)
            window.console.error("AJAX: " + exc);
    });

    $.ajax({ url: HOST,
             async: false,
             cache: false,
             success: function() { http.hasLocal = true; }});

    http.ListExtensions = function() {
        return $.ajax({ url: HOST + "list",
                        dataType: "json",
                        cache: false });
    };

    http.GetExtensionInfo = function() {
        return $.ajax({ url: HOST + "info",
                        dataType: "json",
                        data: {uuid: uuid},
                        cache: false });
{'fraction_non_alphanumeric': 0.14185393258426968, 'fraction_numerical': 0.009363295880149813, 'mean_word_length': 1.5840386940749698, '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': '3844889', 'n_tokens_mistral': 648, 'n_tokens_neox': 602, 'n_words': 147}