<commit_before>var jpeople_server_name, 
jpeople_server_path, 
jpeople_image_server, 
jpeople_server_image_prefix, 
jpeople_server_image_suffix;

(function(){

//
// Config
//

//There should be no need to change this. 

//Where is jPeople?
jpeople_server_name = "jpeople.user.jacobs-university.de";
jpeople_server_path = "/ajax.php";
jpeople_image_server = "swebtst01.public.jacobs-university.de"; //switch this to something else
jpeople_server_image_prefix = "/jPeople/image.php?id=";
jpeople_server_image_suffix = "";

//Map for property names
//Anything not in here will be removed
var jpeople_attr_map = {
	"id": "id",
	"eid": "eid",
	"employeetype": "employeetype",
	"attributes": "attributes",
	"account": "account",
	"attributes": "attributes",
	"fname": "fname",
	"lname": "lname",
	"birthday": "birthday",
	"country": "country",
	"college": "college",
	"majorlong": "majorlong",
	"majorinfo": "majorinfo",
	"major": "major",
	"status": "status",
	"year": "year",
	"room": "room",
	"phone": "phone",
	"email": "email",
	"description": "description",
	"title": "title",
	"office": "office",
	"deptinfo": "deptinfo",
	"block": "block",
	"floor": "floor"
};

//end config

var self = {}; 


//The Search function
self.search = function(query, callback){
	//encode the query
	var query = encodeURIComponent(query);

	//me the search and get a result
	jQuery
	.ajax({
		url: "http://"+jpeople_server_name+jpeople_server_path+"?action=fullAutoComplete&str="+query,
	})
	.done(function(data){
		try{
			var data = (typeof data == "string")?JSON.parse(data):data; 
			var people_tree = data["records"] || []; 
			var people_list = []; 

			for(var i=0;i<people_tree.length;i++){
				var person = people_tree[i]; 

				var person_dict = {}; 

				for(var tag in person){
					if(jpeople_attr_map.hasOwnProperty(tag)){
						person_dict[jpeople_attr_map[tag]] = person[tag]; 
					}
				}

				person_dict["photo"] = "http://"+jpeople_image_server+jpeople_server_image_prefix+person_dict["eid"]+jpeople_server_image_suffix;

				people_list.push(person_dict); 
			}

			callback(people_list); 
		} catch(e){
			callback(false); 
		}
	})
	.fail(function() {
	  callback(false); 
	});

};

self.main = function(query){
	if(query == ""){
		console.log("jPeople API Client (Client Side JavaScript)");
		console.log("(c) <NAME> 2013");
		console.log("Usage: "+args[0]+" $SEARCH"); 
	} else {
		self.search(query, function(res){
			if(!res){
				console.log("Search failed! ");
				console.log("Please make sure you are in the Jacobs University Network / VPN. ");
			} else {
				var out = function (obj, item, pre, post){	<commit_msg>JPeople.js update<commit_after>var jpeople_server_name, 
jpeople_server_path, 
jpeople_image_server, 
jpeople_server_image_prefix, 
jpeople_server_image_suffix,
jpeople_server_protocol;

(function(){

//
// Config
//

//There should be no need to change this. 

//Where is jPeople?
jpeople_server_name = "jpeople.user.jacobs-university.de";
jpeople_server_path = "/ajax.php";
jpeople_image_server = "swebtst01.public.jacobs-university.de"; //switch this to something else
jpeople_server_image_prefix = "/jPeople/image.php?id=";
jpeople_server_image_suffix = "";
jpeople_server_protocol = location.protocol; 

//Map for property names
//Anything not in here will be removed
var jpeople_attr_map = {
	"id": "id",
	"eid": "eid",
	"employeetype": "employeetype",
	"attributes": "attributes",
	"account": "account",
	"attributes": "attributes",
	"fname": "fname",
	"lname": "lname",
	"birthday": "birthday",
	"country": "country",
	"college": "college",
	"majorlong": "majorlong",
	"majorinfo": "majorinfo",
	"major": "major",
	"status": "status",
	"year": "year",
	"room": "room",
	"phone": "phone",
	"email": "email",
	"description": "description",
	"title": "title",
	"office": "office",
	"deptinfo": "deptinfo",
	"block": "block",
	"floor": "floor"
};

//end config

var self = {}; 


//The Search function
self.search = function(query, callback){
	//encode the query
	var query = encodeURIComponent(query);

	//me the search and get a result
	jQuery
	.ajax({
		url: jpeople_server_protocol+"//"+jpeople_server_name+jpeople_server_path+"?action=fullAutoComplete&str="+query,
	})
	.done(function(data){
		try{
			var data = (typeof data == "string")?JSON.parse(data):data; 
			var people_tree = data["records"] || []; 
			var people_list = []; 

			for(var i=0;i<people_tree.length;i++){
				var person = people_tree[i]; 

				var person_dict = {}; 

				for(var tag in person){
					if(jpeople_attr_map.hasOwnProperty(tag)){
						person_dict[jpeople_attr_map[tag]] = person[tag]; 
					}
				}

				person_dict["photo"] = jpeople_server_protocol+"//"+jpeople_image_server+jpeople_server_image_prefix+person_dict["eid"]+jpeople_server_image_suffix;

				people_list.push(person_dict); 
			}

			callback(people_list); 
		} catch(e){
			callback(false); 
		}
	})
	.fail(function() {
	  callback(false); 
	});

};

self.main = function(query){
	if(query == ""){
		console.log("jPeople API Client (Client Side JavaScript)");
		console.log("(c) <NAME> 2013");
		console.log("Usage: "+args[0]+" $SEARCH"); 
	} else {
		self.search(query, function(res){
			if(!res){
				console.log("Search failed! ");
				console.log("Please make sure you are in the Jacobs University Network / VPN. ");
			} else {
				var out = function (obj, item, pre, post){	
{'fraction_non_alphanumeric': 0.17303035947103743, 'fraction_numerical': 0.002980070776680946, 'mean_word_length': 4.5995828988529714, 'pattern_counts': {'":': 50, '<': 7, '<?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': '3604580', 'n_tokens_mistral': 2108, 'n_tokens_neox': 1910, 'n_words': 398}