<commit_before>
exports.getServerFunction = function() {
    var http = require('./http'),
        settings = require('wilson').settings,
        middleware_strings = settings.get_value('middleware'),
        middleware = [],
        conf = require('./conf');
    var sys = require('sys');
    var createWrappedMethod = function(instance, method) {
            return function() {
                method.apply(instance, Array.prototype.slice.call(arguments));
            };
        };
    var createWrappedMiddleware = function(instance, middleware) {
            output_middleware = {};
        for(var name in middleware) {
            output_middleware[name] = createWrappedMethod(instance, middleware[name]); 
        };
        return output_middleware;
    }; 

    for(var i = 0, len = middleware_strings.length; i < len; ++i) {
        var split = middleware_strings[i].split(':'),
            app = split[0],
            rest = split.slice(1).join(':'),
            appInstance = conf.getApplicationInstance(app);
        middleware.push(createWrappedMiddleware(appInstance, appInstance.app.middleware[rest]));
    }

    sys.debug(sys.inspect(middleware));
    return function(request, response) {
        var wilsonRequest = new http.HttpRequest(request, response, middleware);
        wilsonRequest.attemptContinue();
    };
};


<commit_msg>remove debug statements from servers.js<commit_after>
exports.getServerFunction = function() {
    var http = require('./http'),
        settings = require('wilson').settings,
        middleware_strings = settings.get_value('middleware'),
        middleware = [],
        conf = require('./conf');
    var createWrappedMethod = function(instance, method) {
            return function() {
                method.apply(instance, Array.prototype.slice.call(arguments));
            };
        };
    var createWrappedMiddleware = function(instance, middleware) {
            output_middleware = {};
        for(var name in middleware) {
            output_middleware[name] = createWrappedMethod(instance, middleware[name]); 
        };
        return output_middleware;
    }; 

    for(var i = 0, len = middleware_strings.length; i < len; ++i) {
        var split = middleware_strings[i].split(':'),
            app = split[0],
            rest = split.slice(1).join(':'),
            appInstance = conf.getApplicationInstance(app);
        middleware.push(createWrappedMiddleware(appInstance, appInstance.app.middleware[rest]));
    }

    return function(request, response) {
        var wilsonRequest = new http.HttpRequest(request, response, middleware);
        wilsonRequest.attemptContinue();
    };
};



{'fraction_non_alphanumeric': 0.1275318829707427, 'fraction_numerical': 0.002250562640660165, 'mean_word_length': 2.668500687757909, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7079464', 'n_tokens_mistral': 724, 'n_tokens_neox': 702, 'n_words': 136}