<commit_before>function hardyCLI() {
    //Usage:
    // hardy --browser=chrome,phantomjs,ie features/
    // hardy selenium start
    // hardy selenium stop
    // hardy init

    var http = require("http"),
        fs = require('fs'),
        path = require('path'),
        spawn = require('child_process').spawn,
        argParser = require("./argumentParser"),
        VERSION = require('../package.json').version,
        PROPERTIES,
        browsersToTest,
        testFolder,
        numberOfRuns, currentRun,
        hardyPath = path.resolve(require.main.filename, '../..') + '/',
        testPath,
        lockFile = hardyPath + '.seleniumlock';


    function init() {
        console.log('Hardy v' + VERSION);

        PROPERTIES = argParser(process.argv);


        // If we've failed for some reason
        if (PROPERTIES.fail) {
            printMessageAndExit('', 1, true);
        } else {

            // If this is simply a call to initialise the current directory with default test setup
            if (PROPERTIES.init) {

                // Check it hasn't already got files in it
                if (fs.existsSync('selectors/') || fs.existsSync('screenshots/')) {
                    printMessageAndExit('Cannot init a non-empty directory', 1);

                } else {
                    // If the directory is empty, create the default empty files
                    createTestFolder();
                }

            } else {
                // Not just initialising a new folder

                //First check if Selenium is running
                PROPERTIES.seleniumPID = getSeleniumPID();

                http.get("http://127.0.0.1:4444/wd/hub", seleniumIsRunning)
                    .on('error', seleniumIsNotRunning);

            }

        }
    }

    function createTestFolder() {
        fs.writeFile('test.feature', "", function(err) {
            if (err) {
                printMessageAndExit(err, 1);
            } else {
                fs.mkdirSync('selectors');
                fs.mkdirSync('screenshots');
                fs.writeFile('selectors/selectors.js', "module.exports = {};", function(err) {
                    if (err) {
                        printMessageAndExit(err, 1);
                    } else {
                        printMessageAndExit("Test folder created");
                    }
                });
                printMessageAndExit();
            }
        });
    }

    function controlNotRunningSelenium() {
        if (PROPERTIES.seleniumAction === 'start') {
            var selenium = spawn('java', ['-jar', hardyPath + 'bin/selenium-server-standalone-2.32.0.jar']);
            fs.writeFile(lockFile, selenium.pid, function(err) {
                if (err) {
                    console.log(err);
                } else {
                    printMessageAndExit("Selenium running: [" + selenium.pid + "]");
                }
            });<commit_msg>New layout of default test folder<commit_after>function hardyCLI() {
    //Usage:
    // hardy --browser=chrome,phantomjs,ie features/
    // hardy selenium start
    // hardy selenium stop
    // hardy init

    var http = require("http"),
        fs = require('fs'),
        path = require('path'),
        spawn = require('child_process').spawn,
        argParser = require("./argumentParser"),
        VERSION = require('../package.json').version,
        PROPERTIES,
        browsersToTest,
        testFolder,
        numberOfRuns, currentRun,
        hardyPath = path.resolve(require.main.filename, '../..') + '/',
        testPath,
        lockFile = hardyPath + '.seleniumlock';


    function init() {
        console.log('Hardy v' + VERSION);

        PROPERTIES = argParser(process.argv);


        // If we've failed for some reason
        if (PROPERTIES.fail) {
            printMessageAndExit('', 1, true);
        } else {

            // If this is simply a call to initialise the current directory with default test setup
            if (PROPERTIES.init) {

                // Check it hasn't already got files in it
                if (fs.existsSync('selectors/') || fs.existsSync('screenshots/')) {
                    printMessageAndExit('Cannot init a non-empty directory', 1);

                } else {
                    // If the directory is empty, create the default empty files
                    createTestFolder();
                }

            } else {
                // Not just initialising a new folder

                //First check if Selenium is running
                PROPERTIES.seleniumPID = getSeleniumPID();

                http.get("http://127.0.0.1:4444/wd/hub", seleniumIsRunning)
                    .on('error', seleniumIsNotRunning);

            }

        }
    }

    function createTestFolder() {
        fs.writeFile('test.feature', "", function(err) {
            if (err) {
                printMessageAndExit(err, 1);
            } else {
                fs.mkdirSync('screenshots');
                fs.writeFile('selectors.js', "module.exports = {};", function(err) {
                    if (err) {
                        printMessageAndExit(err, 1);
                    } else {
                        printMessageAndExit("Test folder created");
                    }
                });
                printMessageAndExit();
            }
        });
    }

    function controlNotRunningSelenium() {
        if (PROPERTIES.seleniumAction === 'start') {
            var selenium = spawn('java', ['-jar', hardyPath + 'bin/selenium-server-standalone-2.32.0.jar']);
            fs.writeFile(lockFile, selenium.pid, function(err) {
                if (err) {
                    console.log(err);
                } else {
                    printMessageAndExit("Selenium running: [" + selenium.pid + "]");
                }
            });
{'fraction_non_alphanumeric': 0.120698510529019, 'fraction_numerical': 0.0061633281972265025, 'mean_word_length': 1.4891350660417555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7272035', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1476, 'n_words': 336}