<commit_before>var APP = angular.module('APP');
APP.service('_user', ['_http', function(_http) {

    this.user = {
        id: false
    };

    this.is_email_valid = function(email) {
        var mailPattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return mailPattern.test(email);
    };
    /*
        this.get_user = function(data) {
            var _this = this;

            if (!this.user) {
                _http.get('/api/open/user/', data);
            } else return this.user;
        };
    */
    this.create_user = function(data) {
        var _this = this;
        _http.post('/api/open/user/', data)
            .then(function(result) {
                _this.user = result.data.user;
                console.log(_this.user);
            })
    };

}]);<commit_msg>Made _user service use angular copy function to notify APP about changes to _user.user<commit_after>var APP = angular.module('APP');
APP.service('_user', ['_http', function(_http) {

    this.user = {
        id: false
    };

    this.is_email_valid = function(email) {
        var mailPattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return mailPattern.test(email);
    };
    /*
        this.get_user = function(data) {
            var _this = this;

            if (!this.user) {
                _http.get('/api/open/user/', data);
            } else return this.user;
        };
    */
    this.create_user = function(data) {
        var _this = this;
        _http.post('/api/open/user/', data)
            .then(function(result) {
                angular.copy(result.data.user, _this.user);
            });
    };

}]);
{'fraction_non_alphanumeric': 0.2572658772874058, 'fraction_numerical': 0.02045209903121636, 'mean_word_length': 1.833841463414634, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3595042', 'n_tokens_mistral': 705, 'n_tokens_neox': 679, 'n_words': 90}