<commit_before>var utils = {};

utils.randomString = function randomString (length) {
	var chars = "abcdefghijklmnopqrstuvwxyz0123456789",
		string = "";
	for (var k = 0; k < length; k++) {
		string += chars.charAt(Math.floor(chars.length * Math.random()));
	}
	return string;
};

utils.socketJoinRoom = function socketJoinRoom (io, socket, room, drawings) {
	socket.emit('drawings', drawings);
	socket.drawroom = room;
	socket.join(socket.drawroom);
	io.to(socket.drawroom).emit("chat", socket.dName + " joined " + socket.drawroom + ". There are now " + Object.keys(io.nsps['/'].adapter.rooms[socket.drawroom] || {}).length + ' users in this room.');
	console.log(socket.dName + " joined " + socket.drawroom + ". There are now " + Object.keys(io.nsps['/'].adapter.rooms[socket.drawroom] || {}).length + ' users in this room.');
	socket.emit('room', socket.drawroom);
};

utils.convertRowsToDrawings = function convertRowsToDrawings (rows) {
	var drawings = [];
	for (var d = 0; d < rows.length; d++) {
		if (typeof rows[d].x2 === 'number') {
			drawings[d] = [rows[d].dtype, [rows[d].x1, rows[d].y1], [rows[d].x2, rows[d].y2], rows[d].size, rows[d].color];
		} else {
			drawings[d] = [rows[d].dtype, rows[d].x1, rows[d].y1, rows[d].size, rows[d].color];
		}
	}
	return drawings;
};

module.exports = utils;<commit_msg>Tell user he is ready to draw<commit_after>var utils = {};

utils.randomString = function randomString (length) {
	var chars = "abcdefghijklmnopqrstuvwxyz0123456789",
		string = "";
	for (var k = 0; k < length; k++) {
		string += chars.charAt(Math.floor(chars.length * Math.random()));
	}
	return string;
};

utils.socketJoinRoom = function socketJoinRoom (io, socket, room, drawings) {
	socket.emit('drawings', drawings);
	socket.drawroom = room;
	socket.join(socket.drawroom);
	io.to(socket.drawroom).emit("chat", socket.dName + " joined " + socket.drawroom + ". There are now " + Object.keys(io.nsps['/'].adapter.rooms[socket.drawroom] || {}).length + ' users in this room.');
	console.log(socket.dName + " joined " + socket.drawroom + ". There are now " + Object.keys(io.nsps['/'].adapter.rooms[socket.drawroom] || {}).length + ' users in this room.');
	socket.emit('room', socket.drawroom);
	socket.emit('chat', 'You are ready to draw.');
};

utils.convertRowsToDrawings = function convertRowsToDrawings (rows) {
	var drawings = [];
	for (var d = 0; d < rows.length; d++) {
		if (typeof rows[d].x2 === 'number') {
			drawings[d] = [rows[d].dtype, [rows[d].x1, rows[d].y1], [rows[d].x2, rows[d].y2], rows[d].size, rows[d].color];
		} else {
			drawings[d] = [rows[d].dtype, rows[d].x1, rows[d].y1, rows[d].size, rows[d].color];
		}
	}
	return drawings;
};

module.exports = utils;
{'fraction_non_alphanumeric': 0.1997041420118343, 'fraction_numerical': 0.014053254437869823, 'mean_word_length': 4.431726907630522, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3167432', 'n_tokens_mistral': 1016, 'n_tokens_neox': 983, 'n_words': 205}