<commit_before>Ajax = {
    Wrap: function(deferred) {
        /** Wrap a jQuery Ajax deferred object in an ES6-compliant promise.
         *
         * The promise will fail if the HTTP request fails, _or_ if the request
         * returns a JSON object containing "success: false".
         *
         * The rejection object will some properties from the jqXHR object if HTTP request
         * returned an an error code.
         * It will always have a .message property with some kind of message.
         *
         * If the returned JSON object contains a .error property, .message will be set to that.
         * Otherwise, .message will come from jQuery's "errorThrown" parameter. Either way,
         * the object will have a toString() function which just returns .messsage
         */
        return new Promise(function (resolve, reject) {
            deferred.then(function (data) {
                if (_.isObject(data) && !data.success) {
                    reject(data.error ? new Error(data.error) : new Error(gettext("Unknown error")));<commit_msg>Updated some documentation.<commit_after>Ajax = {
    Wrap: function(deferred) {
        /** Wrap a jQuery Ajax deferred object in an ES6-compliant promise.
         *
         * The promise will fail if the HTTP request fails, _or_ if the request
         * returns a JSON object containing "success: false".
         *
         * The rejection will be an Error instance, and may include properties from the jqXHR 
         * object if the HTTP request returned an an error code.
         * Being an Error, it will always have a .message property with some kind of message.
         *
         * If the server's JSON object contains a .error property, .message will be set to that.
         * Otherwise, .message will come from jQuery's "errorThrown" parameter. Either way,
         * the object will have a toString() function which just returns .messsage
         */
        return new Promise(function (resolve, reject) {
            deferred.then(function (data) {
                if (_.isObject(data) && !data.success) {
                    reject(data.error ? new Error(data.error) : new Error(gettext("Unknown error")));
{'fraction_non_alphanumeric': 0.07835990888382688, 'fraction_numerical': 0.0009111617312072893, 'mean_word_length': 2.2485207100591715, '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': '7365282', 'n_tokens_mistral': 553, 'n_tokens_neox': 536, 'n_words': 240}