<commit_before>App.Controllers.controller("usersController",
                           ["$scope", "Restangular", "$timeout", usersController]);
function usersController($scope, Restangular, $timeout) {
    $scope.users = [];
    Restangular.one("api").all("users").getList().then(function(users) {
        users.forEach(function(user) {
            $scope.users.push({email: user.email, fullname: user.fullname});
        });
    });

    $scope.$on("newuser", function(event, user) {
        $timeout(function() {
            $scope.users.push(user);
        });
    });
}

App.Controllers.controller("addUserController",
                           ["$scope", "Restangular", "ws", "$rootScope",
                            addUserController]);
function addUserController($scope, Restangular, ws, $rootScope) {
    var s = ws.get();

    $scope.addUser = function() {
        Restangular.one("api").all("users").post({
            fullname: $scope.username,
            email: $scope.email
        }).then(function(user) {
            s.$emit("adduser", {email: user.email, fullname: user.fullname});
        });
        $scope.username = "";
        $scope.email = "";
    };

    s.$on("adduser", function(user) {
        $rootScope.$broadcast("newuser", user);
    });
}<commit_msg>Comment out debug statement.<commit_after>App.Controllers.controller("usersController",
                           ["$scope", "Restangular", "$timeout", usersController]);
function usersController($scope, Restangular, $timeout) {
    $scope.users = [];
    Restangular.one("api").all("users").getList().then(function(users) {
        users.forEach(function(user) {
            $scope.users.push({email: user.email, fullname: user.fullname});
        });
    });

    $scope.$on("newuser", function(event, user) {
        $timeout(function() {
            //console.log("add user %O", user);
            $scope.users.push(user);
        });
    });
}

App.Controllers.controller("addUserController",
                           ["$scope", "Restangular", "ws", "$rootScope",
                            addUserController]);
function addUserController($scope, Restangular, ws, $rootScope) {
    var s = ws.get();

    $scope.addUser = function() {
        Restangular.one("api").all("users").post({
            fullname: $scope.username,
            email: $scope.email
        }).then(function(user) {
            s.$emit("adduser", {email: user.email, fullname: user.fullname});
        });
        $scope.username = "";
        $scope.email = "";
    };

    s.$on("adduser", function(user) {
        $rootScope.$broadcast("newuser", user);
    });
}
{'fraction_non_alphanumeric': 0.18026565464895636, 'fraction_numerical': 0.0, 'mean_word_length': 2.3881748071979434, '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': '5860798', 'n_tokens_mistral': 752, 'n_tokens_neox': 744, 'n_words': 115}