<commit_before>define(function(require, module, exports) {
    main.consumes = [
        "Plugin", "proc", "settings", "fs", "c9", "util", "http", "info"
    ];
    main.provides = ["run"];
    return main;

    function main(options, imports, register) {
        var Plugin      = imports.Plugin;
        var settings    = imports.settings;
        var proc        = imports.proc;
        var http        = imports.http;
        var util        = imports.util;
        var fs          = imports.fs;
        var c9          = imports.c9;
        var info        = imports.info;

        var basename    = require("path").basename;
        var dirname     = require("path").dirname;
        
        /***** Initialization *****/
        
        var handle     = new Plugin("Ajax.org", main.consumes);
        var handleEmit = handle.getEmitter();
        
        var CLEANING = -2;
        var STOPPING = -1;
        var STOPPED  = 0;
        var STARTING = 1;
        var STARTED  = 2;
        
        var STATIC      = options.staticPrefix;
        var installPath = options.installPath || "~/.c9";
        var TMUX        = options.tmux || installPath + "/bin/tmux";
        var BASH        = "bash";
        
        var runners     = options.runners;
        var testing     = options.testing;
        var runnerPath  = options.runnerPath || "/.c9/runners";
        var base        = options.base;
        var workspace   = info.getWorkspace();
        var processes   = [];
        
        var loaded = false;
        function load(){
            if (loaded) return false;
            loaded = true;
            
            // Settings
            settings.on("read", function(e){
                // Defaults
                settings.setDefaults("project/run", [
                    ["path", runnerPath]
                ]);
            }, handle);
            // @todo Could consider adding a watcher to ~/.c9/runners
        }
        
        /***** Methods *****/
        
        function listRunners(callback){
            var runners = Object.keys(options.runners || {});
            fs.readdir(settings.get("project/run/@path"), function(err, files){
//                if (err && err.code == "ENOENT")
//                    return callback(err);
                
                if (files) {
                    files.forEach(function(file){
                        runners.push(file.name);
                    });
                }
                
                callback(null, runners);
            });
        }
        
        function detectRunner(options, callback){
            listRunners(function(err, names){
                if (err) return callback(err);
                
                var count = 0;
                names.forEach(function(name){
                    if (!runners[name]) {
                        count++;
                        getRunner(name, false, function(){
                            if (--count === 0)<commit_msg>Avoid duplicate custom runners (+1472)<commit_after>define(function(require, module, exports) {
    main.consumes = [
        "Plugin", "proc", "settings", "fs", "c9", "util", "http", "info"
    ];
    main.provides = ["run"];
    return main;

    function main(options, imports, register) {
        var Plugin      = imports.Plugin;
        var settings    = imports.settings;
        var proc        = imports.proc;
        var http        = imports.http;
        var util        = imports.util;
        var fs          = imports.fs;
        var c9          = imports.c9;
        var info        = imports.info;

        var basename    = require("path").basename;
        var dirname     = require("path").dirname;
        
        /***** Initialization *****/
        
        var handle     = new Plugin("Ajax.org", main.consumes);
        var handleEmit = handle.getEmitter();
        
        var CLEANING = -2;
        var STOPPING = -1;
        var STOPPED  = 0;
        var STARTING = 1;
        var STARTED  = 2;
        
        var STATIC      = options.staticPrefix;
        var installPath = options.installPath || "~/.c9";
        var TMUX        = options.tmux || installPath + "/bin/tmux";
        var BASH        = "bash";
        
        var runners     = options.runners;
        var testing     = options.testing;
        var runnerPath  = options.runnerPath || "/.c9/runners";
        var base        = options.base;
        var workspace   = info.getWorkspace();
        var processes   = [];
        
        var loaded = false;
        function load(){
            if (loaded) return false;
            loaded = true;
            
            // Settings
            settings.on("read", function(e){
                // Defaults
                settings.setDefaults("project/run", [
                    ["path", runnerPath]
                ]);
            }, handle);
            // @todo Could consider adding a watcher to ~/.c9/runners
        }
        
        /***** Methods *****/
        
        function listRunners(callback){
            var runners = Object.keys(options.runners || {});
            fs.readdir(settings.get("project/run/@path"), function(err, files){
//                if (err && err.code == "ENOENT")
//                    return callback(err);
                
                if (files) {
                    files.forEach(function(file) {
                        if (runners.indexOf(file.name) < 0)
                            runners.push(file.name);
                    });
                }
                
                callback(null, runners);
            });
        }
        
        function detectRunner(options, callback){
            listRunners(function(err, names){
                if (err) return callback(err);
                
                var count = 0;
                names.forEach(function(name){
                    if (!runners[name]) {
                        count++;
                        getRunner(name, false, function(){
                            if (--count === 0)
{'fraction_non_alphanumeric': 0.11899237653297978, 'fraction_numerical': 0.005137553861451773, 'mean_word_length': 1.2090043923865301, 'pattern_counts': {'":': 0, '<': 4, '<?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': '687129', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1514, 'n_words': 360}