<commit_before>define(['../Utils.js'], function(Utils) {

	var XMLHttpFactories = [
		function () {return new XMLHttpRequest()},
		function () {return new ActiveXObject('Msxml2.XMLHTTP')},
		function () {return new ActiveXObject('Msxml3.XMLHTTP')},
		function () {return new ActiveXObject('Microsoft.XMLHTTP')}
	];

	function createXMLHTTPObject() {
		var xmlhttp = false;
		for (var c = 0; c < XMLHttpFactories.length; c++) {
			try {
				xmlhttp = XMLHttpFactories[c]();
			} catch (e) { continue; }
			break;
		}
		return xmlhttp;
	}

	function doRequest(requestURI, success, fail, requestProps) {
		var request = createXMLHTTPObject();
		if (!request) return fail();

		if (!Utils.isObject(requestProps)) {
			requestProps = {};
		}

		var requestMethod = (
			requestProps.hasOwnProperty('method') &&
			Utils.isString(requestProps.method) &&
			requestProps.method || 'GET'
		);

		var requestHeaders = (
			requestProps.hasOwnProperty('headers') &&
			Utils.isObject(requestProps.headers) &&
			requestProps.headers || {}
		);

		var postData = null;

		if (requestProps.hasOwnProperty('data') &&
			!Utils.isUndefined(requestProps.data)) {
			postData = requestProps.data;
			if (!Utils.isObject(postData)) {
				postData = String(postData);
			}
		}

		try {
			request.open(requestMethod, requestURI, true);

			for (var headerName in requestHeaders) {
				if (requestHeaders.hasOwnProperty(headerName)) {
					request.setRequestHeader(headerName,
						requestHeaders[headerName]
					);
				}
			}

			request.onreadystatechange = function() {
				if (request.readyState !== 4) return;
				var status = request.status;
				if (status > 399 && status < 600) return fail();
				var contentType = request.getResponseHeader('Content-type');
				success(request.responseText, contentType);
			};

			if (Utils.isObject(postData)) {
				var postFields = [];
				for (var fieldName in postData) {
					if (postData.hasOwnProperty(fieldName)) {
						postFields.push(fieldName + '=' +
							encodeURIComponent(postData[fieldName])
						);
					}
				}
				postData = postFields.join('&');
				request.setRequestHeader('Content-type',
					'application/x-www-form-urlencoded'
				);
			}

			request.send(postData);

		} catch (e) { fail(); }
	}

	function removeCallback(callbackId) {<commit_msg>success callback: one argument is enough<commit_after>define(['../Utils.js'], function(Utils) {

	var XMLHttpFactories = [
		function () {return new XMLHttpRequest()},
		function () {return new ActiveXObject('Msxml2.XMLHTTP')},
		function () {return new ActiveXObject('Msxml3.XMLHTTP')},
		function () {return new ActiveXObject('Microsoft.XMLHTTP')}
	];

	function createXMLHTTPObject() {
		var xmlhttp = false;
		for (var c = 0; c < XMLHttpFactories.length; c++) {
			try {
				xmlhttp = XMLHttpFactories[c]();
			} catch (e) { continue; }
			break;
		}
		return xmlhttp;
	}

	function doRequest(requestURI, success, fail, requestProps) {
		var request = createXMLHTTPObject();
		if (!request) return fail();

		if (!Utils.isObject(requestProps)) {
			requestProps = {};
		}

		var requestMethod = (
			requestProps.hasOwnProperty('method') &&
			Utils.isString(requestProps.method) &&
			requestProps.method || 'GET'
		);

		var requestHeaders = (
			requestProps.hasOwnProperty('headers') &&
			Utils.isObject(requestProps.headers) &&
			requestProps.headers || {}
		);

		var postData = null;

		if (requestProps.hasOwnProperty('data') &&
			!Utils.isUndefined(requestProps.data)) {
			postData = requestProps.data;
			if (!Utils.isObject(postData)) {
				postData = String(postData);
			}
		}

		try {
			request.open(requestMethod, requestURI, true);

			for (var headerName in requestHeaders) {
				if (requestHeaders.hasOwnProperty(headerName)) {
					request.setRequestHeader(headerName,
						requestHeaders[headerName]
					);
				}
			}

			request.onreadystatechange = function() {
				if (request.readyState !== 4) return;
				var status = request.status;
				if (status > 399 && status < 600) return fail();
				success(request.responseText);
			};

			if (Utils.isObject(postData)) {
				var postFields = [];
				for (var fieldName in postData) {
					if (postData.hasOwnProperty(fieldName)) {
						postFields.push(fieldName + '=' +
							encodeURIComponent(postData[fieldName])
						);
					}
				}
				postData = postFields.join('&');
				request.setRequestHeader('Content-type',
					'application/x-www-form-urlencoded'
				);
			}

			request.send(postData);

		} catch (e) { fail(); }
	}

	function removeCallback(callbackId) {
{'fraction_non_alphanumeric': 0.14320228420821438, 'fraction_numerical': 0.004392708104546453, 'mean_word_length': 3.5953582240161452, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '6312523', 'n_tokens_mistral': 1753, 'n_tokens_neox': 1419, 'n_words': 273}