<commit_before>function UserList(){
	this.users = {};
}

UserList.prototype = new EventEmitter();

UserList.prototype.newMessage = function(msg){
	var a = msg.action,
	me = this;
	
	if(a == "join"){
		$.extend(me.users, msg.users);
		me.emit('join', msg.users);
		
	} else if(a == "part"){
		var users = me.users;
		$.each(msg.users, function(id, user){if(users[id]) delete users[id]});
		me.emit('part', msg.users);
		
	} else if(a == "who"){
		me.users = msg.users || {};
		me.emit('who', me.users);
		
	} else if(a == "batch"){
		$.each(msg.messages, function(msg){
			me.newMessage(msg);
		});
	}
}

// iteration must halt when f returns false
UserList.prototype.each = function(f){
	$.each(this.users,f);	
}

function UserListUI(ul, container){
	if(!ul) return;
	var user_divs = {},
	sorted = [];
	
	ul.on('join', function(users){
		var names=[];
		$.each(users, function(id, user){
			user.id = id;
			addUser(user);
			names.push(user.name);
		});
	});

	ul.on('part', function(users){
		var names=[];
		$.each(users, function(id, user){
			user.id = id;
			removeUser(user);
			names.push(user.name);
		});		
	});
	
	ul.on('who', function(users){
		clearUserList();
		$.each(users, function(id, user){
			user.id = id;
			addUser(user);
		});
	});
	
	function addUser(user){
		if(user_divs[user.id]) return;
		
		var name_div = user.el = $('<a>');
		name_div.attr({
			id:'user_' + user.id,
			title: user.name,
			href: '/users/' + user.id,
			target: "_blank",
			style: 'color:' + UI.Colors.forUser(user.id) + ';',
			class: 'user'
		});
		name_div.text(user.name);<commit_msg>unbreak wompt on Safari, class is a reserved word in JS<commit_after>function UserList(){
	this.users = {};
}

UserList.prototype = new EventEmitter();

UserList.prototype.newMessage = function(msg){
	var a = msg.action,
	me = this;
	
	if(a == "join"){
		$.extend(me.users, msg.users);
		me.emit('join', msg.users);
		
	} else if(a == "part"){
		var users = me.users;
		$.each(msg.users, function(id, user){if(users[id]) delete users[id]});
		me.emit('part', msg.users);
		
	} else if(a == "who"){
		me.users = msg.users || {};
		me.emit('who', me.users);
		
	} else if(a == "batch"){
		$.each(msg.messages, function(msg){
			me.newMessage(msg);
		});
	}
}

// iteration must halt when f returns false
UserList.prototype.each = function(f){
	$.each(this.users,f);	
}

function UserListUI(ul, container){
	if(!ul) return;
	var user_divs = {},
	sorted = [];
	
	ul.on('join', function(users){
		var names=[];
		$.each(users, function(id, user){
			user.id = id;
			addUser(user);
			names.push(user.name);
		});
	});

	ul.on('part', function(users){
		var names=[];
		$.each(users, function(id, user){
			user.id = id;
			removeUser(user);
			names.push(user.name);
		});		
	});
	
	ul.on('who', function(users){
		clearUserList();
		$.each(users, function(id, user){
			user.id = id;
			addUser(user);
		});
	});
	
	function addUser(user){
		if(user_divs[user.id]) return;
		
		var name_div = user.el = $('<a>');
		name_div.attr({
			id:'user_' + user.id,
			title: user.name,
			href: '/users/' + user.id,
			target: "_blank",
			style: 'color:' + UI.Colors.forUser(user.id) + ';',
			'class': 'user'
		});
		name_div.text(user.name);
{'fraction_non_alphanumeric': 0.21459627329192546, 'fraction_numerical': 0.0, 'mean_word_length': 3.4798331015299024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2735965', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1238, 'n_words': 245}