<commit_before>var fs = require("fs");
var path = require("path");
var core = exports.core = {
	hashColor: function(name) {
		if (colorCache[name]) return colorCache[name];
		var hash = MD5(name);
		var H = parseInt(hash.substr(4, 4), 16) % 360;
		var S = parseInt(hash.substr(0, 4), 16) % 50 + 50;
		var L = parseInt(hash.substr(8, 4), 16) % 20 + 25;
		var m1, m2, hue;
		var r, g, b
		S /= 100;
		L /= 100;
		if (S == 0)
			r = g = b = (L * 255).toString(16);
		else {
			if (L <= 0.5)
				m2 = L * (S + 1);
			else
				m2 = L + S - L * S;
			m1 = L * 2 - m2;
			hue = H / 360;
			r = HueToRgb(m1, m2, hue + 1 / 3);
			g = HueToRgb(m1, m2, hue);
			b = HueToRgb(m1, m2, hue - 1 / 3);
		}
		colorCache[name] = '#' + r + g + b;
		return colorCache[name];
	},
	settings: {
		emoteStatus: true
	},
	//biblia objects
	biblia: {},
	bibliafaction: {},
	emoticons: {},
	processEmoticons: function(text) {
		var patterns = [],
			metachars = /[[\]{}()*+?.\\|^$\-,&#\s]/g,
			self = this;
		for (var i in this.emoticons) {
			if (this.emoticons.hasOwnProperty(i)) {
				patterns.push('(' + i.replace(metachars, "\\$&") + ')');
			}
		}
		return text.replace(new RegExp(patterns.join('|'), 'g'), function(match) {
			return typeof self.emoticons[match] != 'undefined' ?
				'<img src="' + self.emoticons[match] + '" title="' + match + '"/>' :
				match;
		});
	},
	processChatData: function(user, room, connection, message) {
		var match = false;
		for (var i in this.emoticons) {
			if (message.indexOf(i) >= 0) {
				match = true;
			}
		}
		if (!room.emoteStatus) {
			kitty = message = this.processEmoticons(message);
			var message = Tools.escapeHTML(kitty);
			return (message);
			return;
		} else if (room.emoteStatus) {
			if (!match || message.charAt(0) === '!') return true;
			message = Tools.escapeHTML(message);
			message = this.processEmoticons(message);
			if (user.userid === 'panpawn') {
				if (user.hiding) return room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#DA9D01"><small></small><span class="username" data-name="' + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#DA9D01"><small>' + user.group + '</small><span class="username" data-name="' + user.group + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				return false;
			} else if (user.userid === 'shaymin') {
				if (user.hiding) return room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#1F9837"><small></small><span class="username" data-name="' + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#1F9837"><small>' + user.group + '</small><span class="username" data-name="' + user.group + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				return false;
			} else {
				if (user.hiding) return room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="' + hashColor(user.userid) + '"><small></small><span class="username" data-name="' + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="' + hashColor(user.userid) + '"><small>' + user.group + '</small><span class="username" data-name="' + user.group + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				return false;
			}
		}<commit_msg>take room ranks into consideration<commit_after>var fs = require("fs");
var path = require("path");
var core = exports.core = {
	hashColor: function(name) {
		if (colorCache[name]) return colorCache[name];
		var hash = MD5(name);
		var H = parseInt(hash.substr(4, 4), 16) % 360;
		var S = parseInt(hash.substr(0, 4), 16) % 50 + 50;
		var L = parseInt(hash.substr(8, 4), 16) % 20 + 25;
		var m1, m2, hue;
		var r, g, b
		S /= 100;
		L /= 100;
		if (S == 0)
			r = g = b = (L * 255).toString(16);
		else {
			if (L <= 0.5)
				m2 = L * (S + 1);
			else
				m2 = L + S - L * S;
			m1 = L * 2 - m2;
			hue = H / 360;
			r = HueToRgb(m1, m2, hue + 1 / 3);
			g = HueToRgb(m1, m2, hue);
			b = HueToRgb(m1, m2, hue - 1 / 3);
		}
		colorCache[name] = '#' + r + g + b;
		return colorCache[name];
	},
	settings: {
		emoteStatus: true
	},
	//biblia objects
	biblia: {},
	bibliafaction: {},
	emoticons: {},
	processEmoticons: function(text) {
		var patterns = [],
			metachars = /[[\]{}()*+?.\\|^$\-,&#\s]/g,
			self = this;
		for (var i in this.emoticons) {
			if (this.emoticons.hasOwnProperty(i)) {
				patterns.push('(' + i.replace(metachars, "\\$&") + ')');
			}
		}
		return text.replace(new RegExp(patterns.join('|'), 'g'), function(match) {
			return typeof self.emoticons[match] != 'undefined' ?
				'<img src="' + self.emoticons[match] + '" title="' + match + '"/>' :
				match;
		});
	},
	processChatData: function(user, room, connection, message) {
		var match = false;
		for (var i in this.emoticons) {
			if (message.indexOf(i) >= 0) {
				match = true;
			}
		}
		if (!room.emoteStatus) {
			kitty = message = this.processEmoticons(message);
			var message = Tools.escapeHTML(kitty);
			return (message);
			return;
		} else if (room.emoteStatus) {
			if (!match || message.charAt(0) === '!') return true;
			message = Tools.escapeHTML(message);
			message = this.processEmoticons(message);
			if (user.userid === 'panpawn') {
				if (user.hiding) return room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#DA9D01"><small></small><span class="username" data-name="' + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#DA9D01"><small>' + user.group + '</small><span class="username" data-name="' + user.group + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				return false;
			} else if (user.userid === 'shaymin') {
				if (user.hiding) return room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#1F9837"><small></small><span class="username" data-name="' + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				room.add('|raw|<div class="chat"><button class="astext" name="parseCommand" value="/user ' + user.name + '" target="_blank"><strong><font color="#1F9837"><small>' + user.group + '</small><span class="username" data-name="' + user.group + user.name + '">' + user.name + '</span>:</font></strong></button> <em class="mine">' + message + '</em></div>');
				return false;
			} else {
				room.addRaw(user.getIdentity(room).substr(0,1) + '<button class="astext" name="parseCommand" value="/user ' +
				user.name + '">' + '<b><font color="' + hashColor(user.userid) + '">' + Tools.escapeHTML(user.name) + ':</font></b></button> ' + message + '</div>');
				room.update();
				return false;
			}
		}
{'fraction_non_alphanumeric': 0.235895494131011, 'fraction_numerical': 0.01968951154865581, 'mean_word_length': 3.8494492044063646, 'pattern_counts': {'":': 0, '<': 154, '<?xml version=': 0, '>': 154, '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': '838088', 'n_tokens_mistral': 3217, 'n_tokens_neox': 2831, 'n_words': 614}