<commit_before>/*
 Copyright 2011 The Go Authors.  All rights reserved.
 Use of this source code is governed by a BSD-style
 license that can be found in the LICENSE file.
 */

(function (angular) {
    'use strict';
    angular.module('franz', ['ngMessages']);
})(window.angular);

function FranzCtrl($scope, $http) {
    $scope.tasks = [];
    $scope.working = false;
    $scope.errorSending = false;
    $scope.maximumLength = 400;

    var handleError = function (data, status) {
        console.log('code ' + status + ': ' + data);
        $scope.errorSending = true;
        $scope.working = false;
        $scope.date = new Date();
    };

    var refresh = function () {
        return $http.get('/task/').success(function (data) {
            $scope.tasks = data.Tasks;
        }).error(handleError);
    };

    $scope.sendMessage = function () {
        $scope.working = true;
        if (confirm('Do you really want to send this message?')) {
            $http.post('/task/', {Title: $scope.todoText})
                .error(handleError)
                .success(function () {
                    refresh().then(function () {
                        $scope.errorSending = false;
                        $scope.working = false;
                        $scope.todoText = '';
                    })
                });
        } else {
            $scope.working = false;
        }
    };

    $scope.toggleDone = function (task) {
        data = {ID: task.ID, Title: task.Title, Done: !task.Done}
        $http.put('/task/' + task.ID, data)
            .error(handleError)
            .success(function () {
                task.Done = !task.Done
            });
    };

    refresh().then(function () {
        $scope.working = false;
    });
}<commit_msg>renaming<commit_after>/*
 Copyright 2011 The Go Authors.  All rights reserved.
 Use of this source code is governed by a BSD-style
 license that can be found in the LICENSE file.
 */

(function (angular) {
    'use strict';
    angular.module('franz', ['ngMessages']);
})(window.angular);

function FranzCtrl($scope, $http) {
    $scope.messages = [];
    $scope.working = false;
    $scope.errorSending = false;
    $scope.maximumLength = 400;

    var handleError = function (data, status) {
        console.log('code ' + status + ': ' + data);
        $scope.errorSending = true;
        $scope.working = false;
        $scope.date = new Date();
    };

    var refresh = function () {
        return $http.get('/message/')
            .error(handleError)
            .success(function (data) {
                $scope.messages = data.Messages;
            });
    };

    $scope.sendMessage = function () {
        $scope.working = true;
        if (confirm('Do you really want to send this message?')) {
            $http.post('/message/', {Title: $scope.todoText})
                .error(handleError)
                .success(function () {
                    refresh().then(function () {
                        $scope.errorSending = false;
                        $scope.working = false;
                        $scope.todoText = '';
                    })
                });
        } else {
            $scope.working = false;
        }
    };

    $scope.toggleDone = function (message) {
        data = {ID: message.ID, Title: message.Title, Done: !message.Done}
        $http.put('/message/' + message.ID, data)
            .error(handleError)
            .success(function () {
                message.Done = !message.Done
            });
    };

    refresh().then(function () {
        $scope.working = false;
    });
}
{'fraction_non_alphanumeric': 0.14325374791782344, 'fraction_numerical': 0.003886729594669628, 'mean_word_length': 1.686800894854586, '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': '7417549', 'n_tokens_mistral': 1031, 'n_tokens_neox': 978, 'n_words': 233}