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

    function LoginCtrl(Connector, Lang, $scope, $location, $rootScope, CONST) {
        var startTime = new Date().getTime();

        $scope.model = {
            ver: CONST.ver,
            login: "",
            password: "",
            namespace: Connector.namespace,
            error: ""
        };

        $scope.$on('signinerror', this.onError);
        $rootScope.$broadcast('toogleMenu', false);

        $scope.onLoginClick = function() {
            clearError();
            if (!$scope.model.login) { showError(Lang.get('errLoginRequired')); return; }
            if (!$scope.model.password) { showError(Lang.get('errPassRequired')); return; }

            startTime = new Date().getTime();
            Connector
                .signIn($scope.model.login, $scope.model.password, $scope.model.namespace)
                .error(onError)
                .success(onSuccess);
        };

        function onSuccess() {
            Connector.namespace = $scope.model.namespace;

            localStorage.userName = Connector.username;
            localStorage.namespace = Connector.namespace;

            $rootScope.$broadcast('toogleMenu', true);
            var from = $location.search().from;
            if (from) from = decodeURI(from); else from = "/";
            $location.path(from).search({});
        }

        function onError(data, status, headers, config) {
            var respTime = new Date().getTime() - startTime;
            if(respTime >= config.timeout){
                showError(Lang.get("errTimeout"));<commit_msg>namespace and redirect fix<commit_after>(function (){
    'use strict';

    function LoginCtrl(Connector, Lang, $scope, $location, $rootScope, CONST) {
        var startTime = new Date().getTime();

        $scope.model = {
            ver: CONST.ver,
            login: "",
            password: "",
            namespace:  localStorage.namespace || "Samples",
            error: ""
        };

        $scope.$on('signinerror', this.onError);
        $rootScope.$broadcast('toogleMenu', false);

        $scope.onLoginClick = function() {
            clearError();
            if (!$scope.model.login) { showError(Lang.get('errLoginRequired')); return; }
            if (!$scope.model.password) { showError(Lang.get('errPassRequired')); return; }

            startTime = new Date().getTime();
            Connector
                .signIn($scope.model.login, $scope.model.password, $scope.model.namespace)
                .error(onError)
                .success(onSuccess);
        };

        function onSuccess() {
            localStorage.namespace = $scope.model.namespace;
            localStorage.userName = Connector.username;

            $rootScope.$broadcast('toogleMenu', true);
            var from = $location.search().from;
            var search = {};
            if (from) {
                from = decodeURI(from);
                if (~from.indexOf("?")) {
                    var parts = from.split("?");
                    from = parts[0];
                    parts = parts[1].split("&");
                    for (var i = 0; i < parts.length; i++) {
                        var p = parts[i].split("=");
                        if (p.length === 2) {
                            search[p[0]] = p[1];
                        }
                    }
                }
                $location.path(from).search(search);
            }
            else $location.path("/").search({ns: $scope.model.namespace});
        }

        function onError(data, status, headers, config) {
            var respTime = new Date().getTime() - startTime;
            if(respTime >= config.timeout){
                showError(Lang.get("errTimeout"));
{'fraction_non_alphanumeric': 0.14327563249001332, 'fraction_numerical': 0.0015978695073235686, 'mean_word_length': 1.6714082503556187, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4087419', 'n_tokens_mistral': 1002, 'n_tokens_neox': 967, 'n_words': 186}