<commit_before>'use strict';

/* eslint no-console: 0 */

const request = require('superagent');

exports.tearDown = done => {
    const passedStatus = this.results.failed === 0 && this.results.errors === 0;
    console.log(`Final result: "{ passed: ${passedStatus} }"`);

    if (!this.client.globals.dontReportSauceLabs) {
        const userName = this.client.options.username;
        const accessKey = this.client.options.accessKey;
        const sessionId = this.client.capabilities['webdriver.remote.sessionid'];
        const baseUrl = 'https://saucelabs.com/rest/v1/';

        console.log('Sending final result to Saucelabs...');

        if (userName && accessKey && sessionId) {
            request
            .put(`${baseUrl}${userName}/jobs/${sessionId}`)
            .send({ passed: passedStatus })
            .auth(userName, accessKey)
            .end((error, res) => {
                if (error) {
                    console.log('ERROR sending verdict');
                    console.log(error);
                } else {
                    console.log(`Verdict sent to Sauce Labs, response: ${res.res.statusMessage}`);
                }
                done();
            });
        } else {
            console.log(`Username or access key missing, username: ${userName}`);
            done();
        }
    } else {
        console.log('Local testing. Not notifying Saucelabs.');
        done();
    }
};
<commit_msg>Fix teardown function<commit_after>'use strict';

/* eslint no-console: 0 */

const request = require('superagent');

exports.tearDown = function tearDown(done) {
    const passedStatus = this.results.failed === 0 && this.results.errors === 0;
    console.log(`Final result: "{ passed: ${passedStatus} }"`);

    if (!this.client.globals.dontReportSauceLabs) {
        const userName = this.client.options.username;
        const accessKey = this.client.options.accessKey;
        const sessionId = this.client.capabilities['webdriver.remote.sessionid'];
        const baseUrl = 'https://saucelabs.com/rest/v1/';

        console.log('Sending final result to Saucelabs...');

        if (userName && accessKey && sessionId) {
            request
            .put(`${baseUrl}${userName}/jobs/${sessionId}`)
            .send({ passed: passedStatus })
            .auth(userName, accessKey)
            .end((error, res) => {
                if (error) {
                    console.log('ERROR sending verdict');
                    console.log(error);
                } else {
                    console.log(`Verdict sent to Sauce Labs, response: ${res.res.statusMessage}`);
                }
                done();
            });
        } else {
            console.log(`Username or access key missing, username: ${userName}`);
            done();
        }
    } else {
        console.log('Local testing. Not notifying Saucelabs.');
        done();
    }
};

{'fraction_non_alphanumeric': 0.14325068870523416, 'fraction_numerical': 0.0027548209366391185, 'mean_word_length': 1.9492385786802031, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '2824897', 'n_tokens_mistral': 819, 'n_tokens_neox': 794, 'n_words': 169}