<commit_before>(function(){
	app.controller('MainController', function($scope, $http, API_CONFIG) {
		// Start on the login page
		$scope.selected = 'login';
		$scope.config = API_CONFIG;

        $scope.dc = {};
        $scope.filters = {};
        
        $scope.getFilters = function(){
            return $scope.filters;
        }

        $scope.setDataCenter = function(dataCenter){
            $scope.dc = dataCenter;
            $scope.prefixes = buildList(dataCenter.prefixes);
            $scope.filters = {
                dataCenter : dataCenter.value,
                filterBy : $scope.config.filters[0],
                prefix: $scope.prefixes[0],
                filter : ''
            };
        }

        $scope.resetFilters = function(){
            if($scope.dc)
                $scope.setDataCenter( $scope.dc );
            else
                $scope.setDataCenter( $scope.config.dataCenters[0] );
            API_HELPER.loadCodes($scope.populateCodes, $scope.getFilters());
        }

        $scope.resetFilters();
        
        
		$scope.populateCodes = function( codes ){
            trimKeys(codes);
        	$scope.launchCodes = codes;
            if( !$scope.isSelected('list') )
                $scope.selectTab('list');
        	$scope.$apply();
        }

        $scope.populateAudits = function( audits ){
            console.log(audits);
            $scope.auditList = audits;
            $scope.$apply();
        }

        $scope.isSelected = function(val) {
            return $scope.selected === val;
        }

        $scope.selectTab = function(val) {
            var oldElem = $("#" + $scope.selected);
            var newElem = $("#" + val);
            oldElem.slideUp(400, function(){
                newElem.slideDown(400, function() {
                    $scope.selected = val;
                    if(val != "login"){
                        $("#wrapper").removeClass("toggled");
                    }
                    $scope.$apply();
                });
            });

        }

        $scope.login = function(user, pw) {
            API_HELPER.login(user, pw, function(token){
                API_HELPER.saveToken(token);<commit_msg>more bug fixes<commit_after>(function(){
	app.controller('MainController', function($scope, $http, API_CONFIG) {
		// Start on the login page
		$scope.selected = 'login';
		$scope.config = API_CONFIG;

        $scope.dc = {};
        $scope.filters = {};

        $scope.getFilters = function(){
            return $scope.filters;
        }

        $scope.setDataCenter = function(dataCenter){
            $scope.dc = dataCenter;
            $scope.prefixes = buildList(dataCenter.prefixes);
            $scope.filters = {
                dataCenter : dataCenter.value,
                filterBy : $scope.config.filters[0],
                prefix: $scope.prefixes[0],
                filter : ''
            };
        }

        $scope.populateCodes = function( codes ){
            trimKeys(codes);
            $scope.launchCodes = codes;
            if( !$scope.isSelected('list') )
                $scope.selectTab('list');
            $scope.$apply();
        }

        $scope.resetFilters = function(){
            if($scope.dc)
                $scope.setDataCenter( $scope.dc );
            else
                $scope.setDataCenter( $scope.config.dataCenters[0] );
            API_HELPER.loadCodes($scope.populateCodes, $scope.getFilters());
        }

        $scope.resetFilters();

        $scope.populateAudits = function( audits ){
            console.log(audits);
            $scope.auditList = audits;
            $scope.$apply();
        }

        $scope.isSelected = function(val) {
            return $scope.selected === val;
        }

        $scope.selectTab = function(val) {
            var oldElem = $("#" + $scope.selected);
            var newElem = $("#" + val);
            oldElem.slideUp(400, function(){
                newElem.slideDown(400, function() {
                    $scope.selected = val;
                    if(val != "login"){
                        $("#wrapper").removeClass("toggled");
                    }
                    $scope.$apply();
                });
            });

        }

        $scope.login = function(user, pw) {
            API_HELPER.login(user, pw, function(token){
                API_HELPER.saveToken(token);
{'fraction_non_alphanumeric': 0.13829301688726608, 'fraction_numerical': 0.004107713372889092, 'mean_word_length': 1.4846938775510203, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5300229', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1178, 'n_words': 185}