<commit_before>(function () {
	'use strict';
	angular.module('cloudbrain.account')
	.controller('AccountCtrl', ['$scope', '$log', '$matter', '$rootScope', '$state', function ($scope, $log, $matter, $rootScope, $state){
		$scope.data = {username:null, password:<PASSWORD>};

		$scope.login = function(){
			$log.log('Login called', $scope.data);
			$scope.data.loading = true;
			$matter.login({
				username:$scope.data.username,
				password: $<PASSWORD>
			})
			.then(function (loginRes){
				$log.log('Successful login:', loginRes);
				$scope.data.loading = false;
				$rootScope.currentUser = $matter.currentUser;
				$rootScope.$digest();
				$scope.showToast('Logged In');
				$state.go('rtchart');
			}, function (err){
				$scope.data.loading = false;
				$log.error('Error logging in:', err);
				$scope.showToast('Login Error: Invalid Credentials');
			});
		};
		$scope.logout = function(){
			$log.log('Login called', $scope.data);
			$matter.logout()
			.then(function (){
				$log.log('Successful logout');
				$rootScope.currentUser = null;
				$rootScope.$digest();
				$scope.showToast('Logged Out');
				$state.go('home');
			}, function (err){
				$log.error('Error logging out:', err);
			});
		};
		$scope.signup = function(){
			$log.log('Signup called', $scope.data);
			if(!$scope.data.username || !$scope.data.username){
				$scope.showToast('Username and password are required to signup');
			} else {
				$scope.data.loading = true;
				$matter.signup({
					username:$scope.data.username,
					name:$scope.data.name || '',
					email:$scope.data.email || '',
					password: $<PASSWORD>
				})
				.then(function (loginRes){
					$scope.data.loading = false;
					$log.log('Successful login:', loginRes);
					$scope.showToast('Logged In');
					$state.go('chart');
				}, function (err){
					$scope.data.loading = false;
					$log.error('Error logging in:', err);
					var msg = 'Login Error';
					if(err && err.message){
						msg += ' ' + err.message;<commit_msg>Redirect to Realtime Chart after signup<commit_after>(function () {
	'use strict';
	angular.module('cloudbrain.account')
	.controller('AccountCtrl', ['$scope', '$log', '$matter', '$rootScope', '$state', function ($scope, $log, $matter, $rootScope, $state){
		$scope.data = {username:null, password:<PASSWORD>};

		$scope.login = function(){
			$log.log('Login called', $scope.data);
			$scope.data.loading = true;
			$matter.login({
				username:$scope.data.username,
				password: $scope.<PASSWORD>
			})
			.then(function (loginRes){
				$log.log('Successful login:', loginRes);
				$scope.data.loading = false;
				$rootScope.currentUser = $matter.currentUser;
				$rootScope.$digest();
				$scope.showToast('Logged In');
				$state.go('rtchart');
			}, function (err){
				$scope.data.loading = false;
				$log.error('Error logging in:', err);
				$scope.showToast('Login Error: Invalid Credentials');
			});
		};
		$scope.logout = function(){
			$log.log('Login called', $scope.data);
			$matter.logout()
			.then(function (){
				$log.log('Successful logout');
				$rootScope.currentUser = null;
				$rootScope.$digest();
				$scope.showToast('Logged Out');
				$state.go('home');
			}, function (err){
				$log.error('Error logging out:', err);
			});
		};
		$scope.signup = function(){
			$log.log('Signup called', $scope.data);
			if(!$scope.data.username || !$scope.data.username){
				$scope.showToast('Username and password are required to signup');
			} else {
				$scope.data.loading = true;
				$matter.signup({
					username:$scope.data.username,
					name:$scope.data.name || '',
					email:$scope.data.email || '',
					password: <PASSWORD>
				})
				.then(function (loginRes){
					$scope.data.loading = false;
					$log.log('Successful login:', loginRes);
					$scope.showToast('Logged In');
					$state.go('rtchart');
				}, function (err){
					$scope.data.loading = false;
					$log.error('Error logging in:', err);
					var msg = 'Login Error';
					if(err && err.message){
						msg += ' ' + err.message;
{'fraction_non_alphanumeric': 0.1976657561460144, 'fraction_numerical': 0.0, 'mean_word_length': 3.500558659217877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3214723', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1327, 'n_words': 254}