<commit_before>function Sounds(callback) {
	Sounds.names = [];
	Sounds.durations = [];
	Sounds.loadNames(callback);
}

Sounds.loadNames=function(parentCallback){
	var request = "sound/names";
	var callback = function(response) {
		Sounds.names = response.split("\n")
		Sounds.names = Sounds.names.filter(function(n){ return n != "" }); 
		HtmlServer.sendRequest("server/log/LOG:Got_Names"+Sounds.names.length);
		for (var i = 0; i < Sounds.names.length; i++) {
			var request = "sound/duration/" + Sounds.getSoundName(i);
			var durationCallback = function(duration) {
				HtmlServer.sendRequest("server/log/LOG:Got_duration:" + i + ":"+ Sounds.getSoundName(i));
				Sounds.durations[i] = duration;
			}
			HtmlServer.sendRequestWithCallback(request,durationCallback);
		}
		parentCallback();
	};
	HtmlServer.sendRequestWithCallback(request, callback);
};

Sounds.getSoundDuration=function(index){
	return Sounds.durations[index];
};

Sounds.getSoundName=function(index){
	return Sounds.names[index];
};
Sounds.getSoundCount=function(){
	return Sounds.names.length;
};
Sounds.indexFromName=function(soundName){
	return Sounds.names.indexOf(soundName);
};
Sounds.checkNameIsValid=function(soundName){
	return Sounds.indexFromName(soundName)>=0;
};<commit_msg>Update Sounds.js<commit_after>function Sounds() {
	Sounds.names = [];
	Sounds.durations = [];
	Sounds.loadNames();
}

Sounds.loadNames=function(){
	var request = "sound/names";
	var callback = function(response) {
		Sounds.names = response.split("\n")
		Sounds.names = Sounds.names.filter(function(n){ return n != "" }); 
		HtmlServer.sendRequest("server/log/LOG:Got_Names"+Sounds.names.length);
		for (var i = 0; i < Sounds.names.length; i++) {
			var request = "sound/duration/" + Sounds.getSoundName(i);
			var durationCallback = function(duration) {
				HtmlServer.sendRequest("server/log/LOG:Got_duration:" + i + ":"+ Sounds.getSoundName(i));
				Sounds.durations[i] = duration;
			}
			HtmlServer.sendRequestWithCallback(request,durationCallback);
		}
	};
	HtmlServer.sendRequestWithCallback(request, callback);
};

Sounds.getSoundDuration=function(index){
	return Sounds.durations[index];
};

Sounds.getSoundName=function(index){
	return Sounds.names[index];
};
Sounds.getSoundCount=function(){
	return Sounds.names.length;
};
Sounds.indexFromName=function(soundName){
	return Sounds.names.indexOf(soundName);
};
Sounds.checkNameIsValid=function(soundName){
	return Sounds.indexFromName(soundName)>=0;
};
{'fraction_non_alphanumeric': 0.15714864317537464, 'fraction_numerical': 0.0016200891049007696, 'mean_word_length': 5.938202247191011, 'pattern_counts': {'":': 2, '<': 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': '2198678', 'n_tokens_mistral': 847, 'n_tokens_neox': 773, 'n_words': 114}