<commit_before>angular.module('navigationController', [])
.controller('navigationController', ['$scope', '$mdSidenav', '$timeout', 'lispService', 'nextService', function($scope, $mdSidenav, $timeout, lispService, nextService) {

 	// SIDE MENU

 	$scope.openSideMenu = function() {
 		$mdSidenav('right').open();
 	};

 	$scope.closeSideMenu = function() {
 		$mdSidenav('right')
 			.close()
 			.then(function(){
 				$scope.detailMenuState = "";
 			});
		nextService.selectVirtualNetwork($scope.selectedVn);
 	};

 	// Show selected node details
 	$scope.showEidDetails = function(eidaddress) {
 		$timeout(function() {
 			$scope.openSideMenu();
 			// Call lisp module to get the eid information
 			var ipaddress = lispService.getIP(eidaddress);
 			$scope.eidVn = lispService.getEidInfo(ipaddress);
 			var rlocsFromEid = lispService.getRLOCsFromEID(ipaddress);
 			$scope.detailMenuState = "eid";
 			$scope.detailVnIds = [];
 			angular.forEach($scope.eidVn, function(value, key) {
 				$scope.detailVnIds.push(key);
 				// TODO: delete if getEidInfo returns a list of xtrids
 				$scope.eidVn[key]["xtrids"] = [$scope.eidVn[key]["xtr_id"]];
 				$scope.eidVn[key]["rlocs"] = rlocsFromEid[key];
 			});
 			if ($scope.selectedVn && $scope.detailVnIds.includes($scope.selectedVn)) {
 				$scope.eid = $scope.eidVn[$scope.selectedVn];
 				$scope.selectedDetailVnId = $scope.selectedVn;
 			} else {
 				$scope.eid = $scope.eidVn[$scope.detailVnIds[0]];
 				$scope.selectedDetailVnId = $scope.detailVnIds[0];
 			}
 			nextService.highlightEid(eidaddress, $scope.selectedDetailVnId);
	 	});
 	};

 	$scope.selectDetailVn = function(selectedDetailVnId) {
 		if ($scope.detailMenuState == "eid") $scope.eid = $scope.eidVn[selectedDetailVnId];
 		else if ($scope.detailMenuState == "xtr") $scope.xtr["info"] = $scope.xtrVn[selectedDetailVnId];
 	};

 	$scope.showXtrDetails = function(xtrid) {
		$timeout(function() {
	 		$scope.openSideMenu();
	 		$scope.xtr = {
	 			"xtrid": xtrid
	 		};
	 		$scope.xtrVn = {};
 			$scope.xtrVn["eids"]  = lispService.getXTRInfo("EID",xtrid);
 			$scope.xtrVn["rlocs"]  = lispService.getXTRInfo("RLOC",xtrid);
 			
 	 		$scope.detailMenuState = "xtr";
 	 		$scope.detailVnIds = [];
 	 		for (var i = 0; i < $scope.xtrVn["eids"].length; i++) {
 	 			if ($scope.xtrVn["eids"][i]["info"].length != 0 && $scope.xtrVn["rlocs"][i]["info"].length != 0) {
	 	 			var vnId = $scope.xtrVn["eids"][i]["vni"];
	 	 			$scope.detailVnIds.push(vnId);
	 	 			$scope.xtrVn[vnId] = {};
	 	 			$scope.xtrVn[vnId]["eids"] = $scope.xtrVn["eids"][i]["info"];
	 	 			$scope.xtrVn[vnId]["rlocs"] = $scope.xtrVn["rlocs"][i]["info"];
 	 			}
 	 		}
 			if ($scope.selectedVn && $scope.detailVnIds.includes($scope.selectedVn)) {
 				$scope.xtr["info"] = $scope.xtrVn[$scope.selectedVn];
 				$scope.selectedDetailVnId = $scope.selectedVn;
 			} else {
 				$scope.xtr["info"] = $scope.xtrVn[$scope.detailVnIds[0]];
 				$scope.selectedDetailVnId = $scope.detailVnIds[0];
 			}
 			console.log($scope.xtr);
 			console.log($scope.xtrVn);
 			console.log($scope.detailVnIds);
 			nextService.centerOnNode(xtrid, "XTR");
 	 	});
 	};

 	$scope.showRlocDetails = function(rlocid) {
		$timeout(function() {
	 		$scope.openSideMenu();
 			$scope.rloc = lispService.getRlocInfo(rlocid);

 			var eidsFromRloc = lispService.getEIDsFromRLOC(lispService.getIPType($scope.rloc["address_type"]), lispService.getIP($scope.rloc["address"]));
 			console.log(eidsFromRloc);
 			$scope.rloc["eids"] = eidsFromRloc;
 	 		$scope.detailMenuState = "rloc";
 			nextService.centerOnNode(rlocid, "RLOC");
 	 	});
 	};


 	// SELECT VIRTUAL NETWORK

 	$scope.getVnIds = function() {
 		return lispService.getAllVnIds();
 	}

 	$scope.unselectVn = function() {<commit_msg>another one<commit_after>angular.module('navigationController', [])
.controller('navigationController', ['$scope', '$mdSidenav', '$timeout', 'lispService', 'nextService', function($scope, $mdSidenav, $timeout, lispService, nextService) {

 	// SIDE MENU

 	$scope.openSideMenu = function() {
 		$mdSidenav('right').open();
 	};

 	$scope.closeSideMenu = function() {
 		$mdSidenav('right')
 			.close()
 			.then(function(){
 				$scope.detailMenuState = "";
 			});
		nextService.selectVirtualNetwork($scope.selectedVn);
 	};

 	// Show selected node details
 	$scope.showEidDetails = function(eidaddress) {
 		$timeout(function() {
 			$scope.openSideMenu();
 			// Call lisp module to get the eid information
 			var ipaddress = lispService.getIP(eidaddress);
 			$scope.eidVn = lispService.getEidInfo(ipaddress);
 			var rlocsFromEid = lispService.getRLOCsFromEID(ipaddress);
 			$scope.detailMenuState = "eid";
 			$scope.detailVnIds = [];
 			angular.forEach($scope.eidVn, function(value, key) {
 				$scope.detailVnIds.push(key);
 				// TODO: delete if getEidInfo returns a list of xtrids
 				$scope.eidVn[key]["xtrids"] = [$scope.eidVn[key]["xtr_id"]];
 				$scope.eidVn[key]["rlocs"] = rlocsFromEid[key];
 			});
 			if ($scope.selectedVn && $scope.detailVnIds.includes($scope.selectedVn)) {
 				$scope.eid = $scope.eidVn[$scope.selectedVn];
 				$scope.selectedDetailVnId = $scope.selectedVn;
 			} else {
 				$scope.eid = $scope.eidVn[$scope.detailVnIds[0]];
 				$scope.selectedDetailVnId = $scope.detailVnIds[0];
 			}
 			nextService.highlightEid(eidaddress, $scope.selectedDetailVnId);
	 	});
 	};

 	$scope.selectDetailVn = function(selectedDetailVnId) {
 		if ($scope.detailMenuState == "eid") $scope.eid = $scope.eidVn[selectedDetailVnId];
 		else if ($scope.detailMenuState == "xtr") $scope.xtr["info"] = $scope.xtrVn[selectedDetailVnId];
 	};

 	$scope.showXtrDetails = function(xtrid) {
		$timeout(function() {
	 		$scope.openSideMenu();
	 		$scope.xtr = {
	 			"xtrid": xtrid
	 		};
	 		$scope.xtrVn = {};
 			$scope.xtrVn["eids"]  = lispService.getXTRInfo("EID",xtrid);
 			$scope.xtrVn["rlocs"]  = lispService.getXTRInfo("RLOC",xtrid);
 			
 	 		$scope.detailMenuState = "xtr";
 	 		$scope.detailVnIds = [];
 	 		for (var i = 0; i < $scope.xtrVn["eids"].length; i++) {
 	 			if ($scope.xtrVn["eids"][i]["info"].length != 0 && $scope.xtrVn["rlocs"][i]["info"].length != 0) {
	 	 			var vnId = $scope.xtrVn["eids"][i]["vni"];
	 	 			$scope.detailVnIds.push(vnId);
	 	 			$scope.xtrVn[vnId] = {};
	 	 			$scope.xtrVn[vnId]["eids"] = $scope.xtrVn["eids"][i]["info"];
	 	 			$scope.xtrVn[vnId]["rlocs"] = $scope.xtrVn["rlocs"][i]["info"];
 	 			}
 	 		}
 			if ($scope.selectedVn && $scope.detailVnIds.includes($scope.selectedVn)) {
 				$scope.xtr["info"] = $scope.xtrVn[$scope.selectedVn];
 				$scope.selectedDetailVnId = $scope.selectedVn;
 			} else {
 				$scope.xtr["info"] = $scope.xtrVn[$scope.detailVnIds[0]];
 				$scope.selectedDetailVnId = $scope.detailVnIds[0];
 			}
 			console.log($scope.xtr);
 			console.log($scope.xtrVn);
 			console.log($scope.detailVnIds);
 			nextService.centerOnNode(xtrid, "XTR");
 	 	});
 	};

 	$scope.showRlocDetails = function(rlocid) {
		$timeout(function() {
	 		$scope.openSideMenu();
 			$scope.rloc = lispService.getRlocInfo(rlocid);

 			var eidsFromRloc = lispService.getEIDsFromRLOC($scope.rloc["address_type"], $scope.rloc["address"]);
 			console.log(eidsFromRloc);
 			$scope.rloc["eids"] = eidsFromRloc;
 	 		$scope.detailMenuState = "rloc";
 			nextService.centerOnNode(rlocid, "RLOC");
 	 	});
 	};


 	// SELECT VIRTUAL NETWORK

 	$scope.getVnIds = function() {
 		return lispService.getAllVnIds();
 	}

 	$scope.unselectVn = function() {
{'fraction_non_alphanumeric': 0.18456196581196582, 'fraction_numerical': 0.0018696581196581197, 'mean_word_length': 3.9076015727391873, 'pattern_counts': {'":': 2, '<': 5, '<?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': '5310715', 'n_tokens_mistral': 3456, 'n_tokens_neox': 3036, 'n_words': 349}