<commit_before>var x11 = require('./lib');
var Mocha = require('mocha');
var fs = require('fs');
var path = require('path');
var util = require('util');
var async = require('async');

var mocha = new Mocha({
    timeout : 80000,
    reporter : 'spec'
});

// To be able to perform the tests we need the server:
// 1 - to support the dpms extension.
// 2 - dpms version is 1.1.
// 3 - to be dpms capable.
var run_dpms_test = function(X, cb) {
    X.require('dpms', function(ext) {
        if (!util.isError(ext)) {
            dpms = ext;
            dpms.GetVersion(undefined, undefined, function(err, version) {
                if (!err && version[0] === 1 && version[1] === 1) {
                    dpms.Capable(function(err, capable) {
                        if (!err && capable[0] == 1) cb(true);
                        else cb(false);
                    });
                } else {
                    cb(false);
                }
            });
        } else {
            cb(false);
        }
    });
};

var run_xtest_test = function(X, cb) {
    X.require('xtest', function(ext) {
        if (!util.isError(ext)) cb(true);
        else cb(false);
    });
};

var run_randr_test = function(X, cb) {
    X.require('randr', function(ext) {
        if (!util.isError(ext)) {
            randr = ext;
            randr.QueryVersion(1, 2, function(err, version) {
                if (err) {
                    cb(false);
                } else {
                    console.log(version);
                    cb((version[0] === 1) && (version[1] >= 2));
                }
            });
        } else {
            cb(false);
        }
    });
};

x11.createClient(function(err, display) {
    if (err) {
        console.log('Could not create X client');
        process.exit(-1);
    }

    var X = display.client;
    // Add all files from test root directory
    async.forEach(
        fs.readdirSync('./test'),
        function(file, cb) {
            if (file === 'dpms.js') {
                run_dpms_test(X, function(run) {
                    if (run) {<commit_msg>Remove unnecessary log<commit_after>var x11 = require('./lib');
var Mocha = require('mocha');
var fs = require('fs');
var path = require('path');
var util = require('util');
var async = require('async');

var mocha = new Mocha({
    timeout : 80000,
    reporter : 'spec'
});

// To be able to perform the tests we need the server:
// 1 - to support the dpms extension.
// 2 - dpms version is 1.1.
// 3 - to be dpms capable.
var run_dpms_test = function(X, cb) {
    X.require('dpms', function(ext) {
        if (!util.isError(ext)) {
            dpms = ext;
            dpms.GetVersion(undefined, undefined, function(err, version) {
                if (!err && version[0] === 1 && version[1] === 1) {
                    dpms.Capable(function(err, capable) {
                        if (!err && capable[0] == 1) cb(true);
                        else cb(false);
                    });
                } else {
                    cb(false);
                }
            });
        } else {
            cb(false);
        }
    });
};

var run_xtest_test = function(X, cb) {
    X.require('xtest', function(ext) {
        if (!util.isError(ext)) cb(true);
        else cb(false);
    });
};

var run_randr_test = function(X, cb) {
    X.require('randr', function(ext) {
        if (!util.isError(ext)) {
            randr = ext;
            randr.QueryVersion(1, 2, function(err, version) {
                if (err) {
                    cb(false);
                } else {
                    cb((version[0] === 1) && (version[1] >= 2));
                }
            });
        } else {
            cb(false);
        }
    });
};

x11.createClient(function(err, display) {
    if (err) {
        console.log('Could not create X client');
        process.exit(-1);
    }

    var X = display.client;
    // Add all files from test root directory
    async.forEach(
        fs.readdirSync('./test'),
        function(file, cb) {
            if (file === 'dpms.js') {
                run_dpms_test(X, function(run) {
                    if (run) {
{'fraction_non_alphanumeric': 0.154776299879081, 'fraction_numerical': 0.013059250302297461, 'mean_word_length': 1.5265729993891264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3461256', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1240, 'n_words': 307}