<commit_before>var send = require(CONFIG.root + "/core/send").send,
    publicFiles = require(CONFIG.root + "/core/send").publicFiles;
    getDomainApplication = require(CONFIG.root + "/core/model/orient.js").getDomainApplication;

function initScripts(module, errMiid, ie7) {
    
    var baseUrl = "/" + CONFIG.operationKey + "/core/getModule";
    var nl = (CONFIG.dev ? "\r\n" : "");
    
    return "<!DOCTYPE html>" + nl +
        "<html>" + nl +
        "<head>" + nl +
        "<script type='text/javascript'>" + nl +
        (CONFIG.dev ? "// require.js reads this global property, if available" : "") + nl +
        "var require={" + nl +
            "baseUrl:'" + baseUrl + "'" + nl +
        "};" + nl +
        "window.onload=function(){" + nl +
            "N.ok='/"+ CONFIG.operationKey  + "';" + nl +
            "N.em = '" + (errMiid || 0) + "';" +
            "N.mod(document.getElementsByTagName('body')[0],'" + module + "')" + nl +
        "}" + nl +
        "</script>" + nl +
        (ie7 ? "<script src='/" + CONFIG.operationKey + "/core/getClient/json2.js'></script>" + nl : "") +
        "<script src='/" + CONFIG.operationKey + "/core/getClient/require.js'></script>" + nl +
        "<script src='/" + CONFIG.operationKey + "/core/getClient/N.js'></script>" + nl +
        "</head>" + nl +
        "<body></body>" + nl +
        "</html>";
}

exports.route = function(link) {

    // TODO add a favicon
    if (link.req.url === "/favicon.ico") {
        send.ok(link.res);
        return;
    }
    
    getDomainApplication(link.host, true, function(err, result) {
        
        if (err || !result.routes) {
            
            send.notfound(link, err || "No routing table found");
            return;
        }
        
        var module = traverse(link.pathname != "/" ? link.pathname.replace(/\/$/, "") : link.pathname, result.routes, "");
        <commit_msg>create error module attribute only if error module miid exists<commit_after>var send = require(CONFIG.root + "/core/send").send,
    publicFiles = require(CONFIG.root + "/core/send").publicFiles;
    getDomainApplication = require(CONFIG.root + "/core/model/orient.js").getDomainApplication;

function initScripts(module, errMiid, ie7) {
    
    var baseUrl = "/" + CONFIG.operationKey + "/core/getModule";
    var nl = (CONFIG.dev ? "\r\n" : "");
    
    return "<!DOCTYPE html>" + nl +
        "<html>" + nl +
        "<head>" + nl +
        "<script type='text/javascript'>" + nl +
        (CONFIG.dev ? "// require.js reads this global property, if available" : "") + nl +
        "var require={" + nl +
            "baseUrl:'" + baseUrl + "'" + nl +
        "};" + nl +
        "window.onload=function(){" + nl +
            "N.ok='/"+ CONFIG.operationKey  + "';" + nl +
            (errMiid ? "N.em = '" + errMiid + "';" : "") +
            "N.mod(document.getElementsByTagName('body')[0],'" + module + "')" + nl +
        "}" + nl +
        "</script>" + nl +
        (ie7 ? "<script src='/" + CONFIG.operationKey + "/core/getClient/json2.js'></script>" + nl : "") +
        "<script src='/" + CONFIG.operationKey + "/core/getClient/require.js'></script>" + nl +
        "<script src='/" + CONFIG.operationKey + "/core/getClient/N.js'></script>" + nl +
        "</head>" + nl +
        "<body></body>" + nl +
        "</html>";
}

exports.route = function(link) {

    // TODO add a favicon
    if (link.req.url === "/favicon.ico") {
        send.ok(link.res);
        return;
    }
    
    getDomainApplication(link.host, true, function(err, result) {
        
        if (err || !result.routes) {
            
            send.notfound(link, err || "No routing table found");
            return;
        }
        
        var module = traverse(link.pathname != "/" ? link.pathname.replace(/\/$/, "") : link.pathname, result.routes, "");
        
{'fraction_non_alphanumeric': 0.2001555613170858, 'fraction_numerical': 0.00233341975628727, 'mean_word_length': 2.076555023923445, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '1820882', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1271, 'n_words': 239}