<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.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(uuid) {
        return $.ajax({ url: HOST + "info",
                        dataType: "json",
                        data: {uuid: uuid},
                        cache: false });
    };<commit_msg>Document and replace some status constants.<commit_after>(function($) {

    var SweetTooth = window.SweetTooth = {};
    var state = SweetTooth.State = {
        // These constants should be kept in sync
        // with those in gnome-shell: see js/ui/extensionSystem.js
        ENABLED: 1,
        DISABLED: 2,
        ERROR: 3,
        OUT_OF_DATE: 4,

        // Not a real state, used when there's no extension
        // with the associated UUID in the extension map.
        UNINSTALLED: 99
    };

    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(uuid) {
        return $.ajax({ url: HOST + "info",
                        dataType: "json",
                        data: {uuid: uuid},
                        cache: false });
    };
{'fraction_non_alphanumeric': 0.134233853946813, 'fraction_numerical': 0.008864499788940482, 'mean_word_length': 1.6130099228224917, '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': '4309787', 'n_tokens_mistral': 706, 'n_tokens_neox': 656, 'n_words': 173}