<commit_before>var NCOMBO_PORT = {{port}};
var NCOMBO_SOCKET = io.connect('{{endpoint}}');

var IE = false;
var IE_VERSION = 0;

if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
	IE = true;
	IE_VERSION = new Number(RegExp.$1)
}

var spinnerOpts = {
  lines: 8,
  length: 5,
  width: 3,
  radius: 7,
  corners: 0,
  rotate: 0,
  color: '#666',
  speed: 1,
  trail: 60,
  shadow: false,
  hwaccel: false,
  className: 'ncspinner',
  zIndex: 2e9,
  top: 'auto',
  left: 'auto'
};

var spinnerDiv = document.createElement('div');

spinnerDiv.id = 'ncspinner';
spinnerDiv.style.width = spinnerOpts.radius * 2 + 'px';
spinnerDiv.style.height = spinnerOpts.radius * 2 + 'px';
spinnerDiv.style.position = 'absolute';
spinnerDiv.style.left = '50%';
spinnerDiv.style.top = '50%';

var spinner = new Spinner(spinnerOpts).spin(spinnerDiv);

var appendSpinner = function() {
	document.body.appendChild(spinnerDiv);
}

var bodyReadyInterval = setInterval(function() {
	if(document.body) {
		clearInterval(bodyReadyInterval);
		appendSpinner();
	}
}, 20);

function setCookie(name, value, expirySeconds) {
	var exdate = null;
	if(expirySeconds) {
		exdate = new Date();
		exdate.setTime(exdate.getTime() + Math.round(expirySeconds * 1000));
	}
	var value = escape(value) + '; path=/;' + ((exdate == null) ? "" : " expires=" + exdate.toUTCString() + ";");
	document.cookie = name + "=" + value;
}

function getCookie(name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for(i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if(x == name) {
            return unescape(y);
        }
    }
}

var _getHTTPReqObject = function() {
	var xmlhttp = null;
	if(IE) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (exceptionA) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (exceptionB) {
				xmlhttp = null;
			}
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = null;
		}
	}
	if(!xmlhttp) {
		throw "Could not instantiate XMLHttpRequest";
	}
	return xmlhttp;
}

var ajax = function(settings) {
	var type;
	if(settings.type) {
		type = settings.type;
	} else {
		type = "GET";
	}

	var xmlhttp = _getHTTPReqObject();
	xmlhttp.open(type, settings.url, true);
	xmlhttp.onreadystatechange = function() {
		if(xmlhttp.readyState == 4) {
			if(xmlhttp.status == 200) {
				if(settings.success) {
					settings.success(xmlhttp.responseText);
				}
			} else {
				if(settings.error) {
					settings.error(xmlhttp.statusText);
				} else {
					throw "Failed to load resource: " + url;
				}
			}
		}
	}
	xmlhttp.send();
}

var globalEval = function(src) {
	if(window.execScript) {
		window.execScript(src);
	} else {
		(function() {
			window.eval.call(window, src);
		})();
	}
}

NCOMBO_SOCKET.socket.on('error', function(err) {
	var head = document.getElementsByTagName('head');
	if(head) {
		head = head[0];
	}
	
	if(err == 'handshake error') {
		var limitScript = document.createElement('script');
		limitScript.type = 'text/javascript';
		limitScript.src = smartCacheManager.setURLCacheVersion('/node_modules/ncombo/scripts/connectionlimit.js');
		head.appendChild(limitScript);
	}
});

var cacheCookieName = 'nccachecookie';
var NCOMBO_IS_FRESH = getCookie(cacheCookieName) ? false : true;

setCookie(cacheCookieName, '1', 31556909);

NCOMBO_SOCKET.on('connect', function() {
	var sessionID = NCOMBO_SOCKET.socket.sessionid;
	
	setCookie('ncsid', sessionID);

	var head = document.getElementsByTagName('head');
	if(head) {
		head = head[0];
	}
	
	var onScriptLoad = function(scriptTag, callback) {
		if(!IE || IE_VERSION > 8) {
			scriptTag.onload = function() {
				callback();
			}
		} else {
			scriptTag.onreadystatechange = function() {
				if(this.readyState == 'complete' || this.readyState == 'loaded') {
					callback();
				}
			}<commit_msg>Renamed cookie<commit_after>var NCOMBO_PORT = {{port}};
var NCOMBO_SOCKET = io.connect('{{endpoint}}');

var IE = false;
var IE_VERSION = 0;

if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
	IE = true;
	IE_VERSION = new Number(RegExp.$1)
}

var spinnerOpts = {
  lines: 8,
  length: 5,
  width: 3,
  radius: 7,
  corners: 0,
  rotate: 0,
  color: '#666',
  speed: 1,
  trail: 60,
  shadow: false,
  hwaccel: false,
  className: 'ncspinner',
  zIndex: 2e9,
  top: 'auto',
  left: 'auto'
};

var spinnerDiv = document.createElement('div');

spinnerDiv.id = 'ncspinner';
spinnerDiv.style.width = spinnerOpts.radius * 2 + 'px';
spinnerDiv.style.height = spinnerOpts.radius * 2 + 'px';
spinnerDiv.style.position = 'absolute';
spinnerDiv.style.left = '50%';
spinnerDiv.style.top = '50%';

var spinner = new Spinner(spinnerOpts).spin(spinnerDiv);

var appendSpinner = function() {
	document.body.appendChild(spinnerDiv);
}

var bodyReadyInterval = setInterval(function() {
	if(document.body) {
		clearInterval(bodyReadyInterval);
		appendSpinner();
	}
}, 20);

function setCookie(name, value, expirySeconds) {
	var exdate = null;
	if(expirySeconds) {
		exdate = new Date();
		exdate.setTime(exdate.getTime() + Math.round(expirySeconds * 1000));
	}
	var value = escape(value) + '; path=/;' + ((exdate == null) ? "" : " expires=" + exdate.toUTCString() + ";");
	document.cookie = name + "=" + value;
}

function getCookie(name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for(i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if(x == name) {
            return unescape(y);
        }
    }
}

var _getHTTPReqObject = function() {
	var xmlhttp = null;
	if(IE) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (exceptionA) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (exceptionB) {
				xmlhttp = null;
			}
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = null;
		}
	}
	if(!xmlhttp) {
		throw "Could not instantiate XMLHttpRequest";
	}
	return xmlhttp;
}

var ajax = function(settings) {
	var type;
	if(settings.type) {
		type = settings.type;
	} else {
		type = "GET";
	}

	var xmlhttp = _getHTTPReqObject();
	xmlhttp.open(type, settings.url, true);
	xmlhttp.onreadystatechange = function() {
		if(xmlhttp.readyState == 4) {
			if(xmlhttp.status == 200) {
				if(settings.success) {
					settings.success(xmlhttp.responseText);
				}
			} else {
				if(settings.error) {
					settings.error(xmlhttp.statusText);
				} else {
					throw "Failed to load resource: " + url;
				}
			}
		}
	}
	xmlhttp.send();
}

var globalEval = function(src) {
	if(window.execScript) {
		window.execScript(src);
	} else {
		(function() {
			window.eval.call(window, src);
		})();
	}
}

NCOMBO_SOCKET.socket.on('error', function(err) {
	var head = document.getElementsByTagName('head');
	if(head) {
		head = head[0];
	}
	
	if(err == 'handshake error') {
		var limitScript = document.createElement('script');
		limitScript.type = 'text/javascript';
		limitScript.src = smartCacheManager.setURLCacheVersion('/node_modules/ncombo/scripts/connectionlimit.js');
		head.appendChild(limitScript);
	}
});

var cacheCookieName = 'nccache';
var NCOMBO_IS_FRESH = getCookie(cacheCookieName) ? false : true;

setCookie(cacheCookieName, '1', 31556909);

NCOMBO_SOCKET.on('connect', function() {
	var sessionID = NCOMBO_SOCKET.socket.sessionid;
	
	setCookie('ncsid', sessionID);

	var head = document.getElementsByTagName('head');
	if(head) {
		head = head[0];
	}
	
	var onScriptLoad = function(scriptTag, callback) {
		if(!IE || IE_VERSION > 8) {
			scriptTag.onload = function() {
				callback();
			}
		} else {
			scriptTag.onreadystatechange = function() {
				if(this.readyState == 'complete' || this.readyState == 'loaded') {
					callback();
				}
			}
{'fraction_non_alphanumeric': 0.16845745337779425, 'fraction_numerical': 0.011856243052982586, 'mean_word_length': 3.6972157772621808, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 36}, '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': '4651147', 'n_tokens_mistral': 3277, 'n_tokens_neox': 2968, 'n_words': 567}