<commit_before>(function () {
    'use strict';

    var eventsApp = angular.module("eventsApp", ['ui.bootstrap',
                                                'ui.router',
                                                'uuid',
                                                'growlNotifications',
                                                'events.admin',
                                                'formly',
                                                'formlyBootstrap',
                                                'eda.easyformGen.stepway',
                                                'eda.easyFormViewer',
                                                'angular-zipcode-filter',
                                                'events',
                                                'ngMessages',
                                                'ngFileUpload',
                                                'forgot.password',
                                                'events.payments',
                                                'credit-cards']);

    eventsApp.config(function($stateProvider, $urlRouterProvider, easyFormSteWayConfigProvider) {
        easyFormSteWayConfigProvider.showPreviewPanel(false);
        //show/hide models in preview panel => default is true
        easyFormSteWayConfigProvider.showPreviewModels(false);

        $urlRouterProvider.otherwise('/home');

        $stateProvider
            .state('home', {
                url: '/home',
                templateUrl: 'partials/home.html',
                controller: ['$scope', function ($scope) {
                    $scope.test = true;

                    $scope.callFn = function () {
                        alert("called");
                        $scope.test = false;
                    };
                }]
            })
            .state('resetPassword', {
                url: '/recover-account/reset-password/:userId/:passwordHash',
                templateUrl: 'partials/util/recover-password-home.html',
                controller: ['$state', '$scope', '$http', '$stateParams', function ($state, $scope, $http, $stateParams) {
                    $scope.resetPassword = function (reqPassword) {
                        $http({
                            method: 'POST',
                            url: '/recover-account/' + $stateParams.userId + "/" + $stateParams.passwordHash,
                            data: {newPassword: <PASSWORD>}
                        }).then(function () {
                            $state.go('login');
                        });
                    }
                }]
            })
            .state('forgotPassword', {
                url: '/forgot-password',
                templateUrl: 'partials/util/forgot-password-home.html'
            })
            .state('forgotPassword.success', {
                url: '/success',
                templateUrl: 'partials/util/forgot-password-success.html'
            })
            .state('forgotPassword.failure', {
                url: '/failure',
                templateUrl: 'partials/util/forgot-password-failure.html'
            })
            .state('login', {
                url: '/login',
                templateUrl: 'partials/login.html',
                controller: ['$rootScope', '$scope', '$http', '$window', '$state', function ($rootScope, $scope, $http, $window, $state) {
                    $scope.register = false;
                    $scope.toggleRegister = function () {
                        $scope.register = !$scope.register;
                    };

                    $scope.loginUser = function (email, password) {
                        var userData = {
                            "email": email,
                            "password": password
                        };

                        $http({
                            method: 'POST',
                            url: '/login',
                            data: userData
                        }).then(function (response) {
                            if (response.data.token) {
                                $scope.invalidUserLogin = false;
                                $window.sessionStorage.token = response.data.token;
                                $window.sessionStorage.userDetails = response.data.data[0].name;
                                $window.sessionStorage.isAdmin = response.data.data[0].isAdmin;
                                $window.sessionStorage.userId = response.data.data[0]._id;
                                $window.sessionStorage.userEmail = response.data.data[0].email;
                                $rootScope.$broadcast('home.login', response.data.data);
                                $state.go('home');
                            } else {
                                console.warn("User not authenticated to login!");
                                $scope.invalidUserLogin = true;
                            }
                        }, function error (error) {
                            console.warn("User not authenticated to login!");
                            $scope.invalidUserLogin = true;
                        });
                    };

                    $scope.registerUser = function (user) {
                        user.isAdmin = false;

                        $http({
                            method: 'POST',
                            url: '/users',
                            data: user
                        }).then(function (response) {
                            if (response.data.token) {
                                $window.sessionStorage.token = response.data.token;
                                $window.sessionStorage.userDetails = response.data.data[0].name;
                                $window.sessionStorage.userId = response.data.data[0]._id;
                                $rootScope.$broadcast('home.login', response.data.data);
                                $state.go('home');
                            } else {
                                console.warn("Registration of User failed!");
                                $scope.invalidRegisterLogin = true;
                            }
                        }, function error (error) {
                            console.warn("User exists!");
                            $scope.invalidRegisterLogin = true;
                        });
                    };
                }]
            })
            .state('events', {
                url: '/events',
                templateUrl: 'partials/events-list.html',
                controller: ['$window', '$scope', '$http', '$state', function ($window, $scope, $http, $state) {
                    $http({
                        method: 'GET',
                        url: '/events'
                    }).then(function (response) {
                        $scope.events = response.data;

                        $scope.currentPage = 0;<commit_msg>Show only active events while finding events<commit_after>(function () {
    'use strict';

    var eventsApp = angular.module("eventsApp", ['ui.bootstrap',
                                                'ui.router',
                                                'uuid',
                                                'growlNotifications',
                                                'events.admin',
                                                'formly',
                                                'formlyBootstrap',
                                                'eda.easyformGen.stepway',
                                                'eda.easyFormViewer',
                                                'angular-zipcode-filter',
                                                'events',
                                                'ngMessages',
                                                'ngFileUpload',
                                                'forgot.password',
                                                'events.payments',
                                                'credit-cards']);

    eventsApp.config(function($stateProvider, $urlRouterProvider, easyFormSteWayConfigProvider) {
        easyFormSteWayConfigProvider.showPreviewPanel(false);
        //show/hide models in preview panel => default is true
        easyFormSteWayConfigProvider.showPreviewModels(false);

        $urlRouterProvider.otherwise('/home');

        $stateProvider
            .state('home', {
                url: '/home',
                templateUrl: 'partials/home.html',
                controller: ['$scope', function ($scope) {
                    $scope.test = true;

                    $scope.callFn = function () {
                        alert("called");
                        $scope.test = false;
                    };
                }]
            })
            .state('resetPassword', {
                url: '/recover-account/reset-password/:userId/:passwordHash',
                templateUrl: 'partials/util/recover-password-home.html',
                controller: ['$state', '$scope', '$http', '$stateParams', function ($state, $scope, $http, $stateParams) {
                    $scope.resetPassword = function (reqPassword) {
                        $http({
                            method: 'POST',
                            url: '/recover-account/' + $stateParams.userId + "/" + $stateParams.passwordHash,
                            data: {newPassword: <PASSWORD>}
                        }).then(function () {
                            $state.go('login');
                        });
                    }
                }]
            })
            .state('forgotPassword', {
                url: '/forgot-password',
                templateUrl: 'partials/util/forgot-password-home.html'
            })
            .state('forgotPassword.success', {
                url: '/success',
                templateUrl: 'partials/util/forgot-password-success.html'
            })
            .state('forgotPassword.failure', {
                url: '/failure',
                templateUrl: 'partials/util/forgot-password-failure.html'
            })
            .state('login', {
                url: '/login',
                templateUrl: 'partials/login.html',
                controller: ['$rootScope', '$scope', '$http', '$window', '$state', function ($rootScope, $scope, $http, $window, $state) {
                    $scope.register = false;
                    $scope.toggleRegister = function () {
                        $scope.register = !$scope.register;
                    };

                    $scope.loginUser = function (email, password) {
                        var userData = {
                            "email": email,
                            "password": password
                        };

                        $http({
                            method: 'POST',
                            url: '/login',
                            data: userData
                        }).then(function (response) {
                            if (response.data.token) {
                                $scope.invalidUserLogin = false;
                                $window.sessionStorage.token = response.data.token;
                                $window.sessionStorage.userDetails = response.data.data[0].name;
                                $window.sessionStorage.isAdmin = response.data.data[0].isAdmin;
                                $window.sessionStorage.userId = response.data.data[0]._id;
                                $window.sessionStorage.userEmail = response.data.data[0].email;
                                $rootScope.$broadcast('home.login', response.data.data);
                                $state.go('home');
                            } else {
                                console.warn("User not authenticated to login!");
                                $scope.invalidUserLogin = true;
                            }
                        }, function error (error) {
                            console.warn("User not authenticated to login!");
                            $scope.invalidUserLogin = true;
                        });
                    };

                    $scope.registerUser = function (user) {
                        user.isAdmin = false;

                        $http({
                            method: 'POST',
                            url: '/users',
                            data: user
                        }).then(function (response) {
                            if (response.data.token) {
                                $window.sessionStorage.token = response.data.token;
                                $window.sessionStorage.userDetails = response.data.data[0].name;
                                $window.sessionStorage.userId = response.data.data[0]._id;
                                $rootScope.$broadcast('home.login', response.data.data);
                                $state.go('home');
                            } else {
                                console.warn("Registration of User failed!");
                                $scope.invalidRegisterLogin = true;
                            }
                        }, function error (error) {
                            console.warn("User exists!");
                            $scope.invalidRegisterLogin = true;
                        });
                    };
                }]
            })
            .state('events', {
                url: '/events',
                templateUrl: 'partials/events-list.html',
                controller: ['$window', '$scope', '$http', '$state', '$filter', function ($window, $scope, $http, $state, $filter) {
                    $http({
                        method: 'GET',
                        url: '/events'
                    }).then(function (response) {
                        $scope.events = $filter('eventsFilter')(response.data, 'active');

                        $scope.currentPage = 0;
{'fraction_non_alphanumeric': 0.10777761979240723, 'fraction_numerical': 0.0009953078344945257, 'mean_word_length': 0.8963332434618495, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4392543', 'n_tokens_mistral': 2973, 'n_tokens_neox': 2791, 'n_words': 488}