<commit_before>;var SockWrap = function(io) {
	var cs = {};
	cs.io = io;
	cs.encode = function(str) {
		return encodeURIComponent(str);
	};
	cs.decode = function (str) {
		return decodeURIComponent(str);
	};
	cs.on = function(what, callback) {
		cs.io.on(what, function(data) {
			callback(data);
		});
	};
	cs.onString = function(what, callback) {
		cs.io.on(what, function(data) {
			callback(cs.decode(data));
		});
	};
	cs.onJson = function(what, callback) {
		cs.io.on(what, function(data) {
			var decoded, json;
			try {
				decoded = cs.decode(data);
			} catch (e) {
				console.log("ERROR SockWrap.decode(): error decoding data: [" + data + "]: " + e);
			}
			try {
				json = JSON.parse(decoded);
			} catch (e) {
				console.log("ERROR SockWrap.decode(): error parsing json `" + decoded + " `: " + e);
			}
			callback(json);
		});
	};
	cs.emit = function(what, data) {
		switch (typeof data) {
			case "object":
				arguments[1] = cs.encode(JSON.stringify(data));
				break;
			case "string":
				arguments[1] = cs.encode(data);
				break;
		}
		cs.io.emit.apply(cs.io, arguments);
	};
	cs.connect = function() {
		cs.io.connect();
	};
	cs.disconnect = function() {
		cs.io.disconnect();
	};
	return cs;
};
<commit_msg>fs#5240 SockWrap: add flag for forcedLongPolling<commit_after>;var SockWrap = function(io, forcedLongPolling) {
	var cs = {};
	cs.io = io;
	cs.forcedLongPolling = forcedLongPolling;
	cs.encode = function(str) {
		return encodeURIComponent(str);
	};
	cs.decode = function (str) {
		return decodeURIComponent(str);
	};
	cs.on = function(what, callback) {
		cs.io.on(what, function(data) {
			callback(data);
		});
	};
	cs.onString = function(what, callback) {
		cs.io.on(what, function(data) {
			callback(cs.decode(data));
		});
	};
	cs.onJson = function(what, callback) {
		cs.io.on(what, function(data) {
			var decoded, json;
			try {
				decoded = cs.decode(data);
			} catch (e) {
				console.log("ERROR SockWrap.decode(): error decoding data: [" + data + "]: " + e);
			}
			try {
				json = JSON.parse(decoded);
			} catch (e) {
				console.log("ERROR SockWrap.decode(): error parsing json `" + decoded + " `: " + e);
			}
			callback(json);
		});
	};
	cs.emit = function(what, data) {
		switch (typeof data) {
			case "object":
				arguments[1] = cs.encode(JSON.stringify(data));
				break;
			case "string":
				arguments[1] = cs.encode(data);
				break;
		}
		cs.io.emit.apply(cs.io, arguments);
	};
	cs.connect = function() {
		cs.io.connect();
	};
	cs.disconnect = function() {
		cs.io.disconnect();
	};
	return cs;
};

{'fraction_non_alphanumeric': 0.184939523995318, 'fraction_numerical': 0.0031213421771361686, 'mean_word_length': 3.2450331125827816, 'pattern_counts': {'":': 4, '<': 3, '<?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': '5549417', 'n_tokens_mistral': 1092, 'n_tokens_neox': 963, 'n_words': 182}