<commit_before>'use strict';

/**
 * @ngdoc service
 * @name waxeApp.Message
 * @description
 * # Message
 * Service in the waxeApp.
 */
angular.module('waxeApp')
    .service('MessageService', ['$timeout', function ($timeout) {
        this.message = null;
        this.type = null;
        this.timer = null;

        this.set = function(type, message, classname, timeout) {
            if (this.timer) {
                // Stop the timer
                $timeout.cancel(this.timer);
            }
            this.type = type;
            this.message = message;
            this.classname = angular.isDefined(classname)? classname: this.type;

            timeout = angular.isDefined(timeout)? timeout: 500;
            if (this.type === 'success' || timeout) {
                var that = this;
                this.timer = $timeout(function () {
                    that.close();
                }, timeout);
            }
        };

        this.setIfEmpty = function(type, message, classname) {
            if (this.message) {
                return false;
            }
            this.set(type, message, classname);<commit_msg>Do not autoclose all the message<commit_after>'use strict';

/**
 * @ngdoc service
 * @name waxeApp.Message
 * @description
 * # Message
 * Service in the waxeApp.
 */
angular.module('waxeApp')
    .service('MessageService', ['$timeout', function ($timeout) {
        this.message = null;
        this.type = null;
        this.timer = null;

        this.set = function(type, message, classname, timeout) {
            if (this.timer) {
                // Stop the timer
                $timeout.cancel(this.timer);
            }
            this.type = type;
            this.message = message;
            this.classname = angular.isDefined(classname)? classname: this.type;

            var realtimeout = angular.isDefined(timeout)? timeout: 3000;
            if (this.type === 'success' || angular.isDefined(timeout)) {
                var that = this;
                this.timer = $timeout(function () {
                    that.close();
                }, realtimeout);
            }
        };

        this.setIfEmpty = function(type, message, classname) {
            if (this.message) {
                return false;
            }
            this.set(type, message, classname);
{'fraction_non_alphanumeric': 0.12419424151267727, 'fraction_numerical': 0.0030081650193382035, 'mean_word_length': 1.6275395033860045, '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': '5192871', 'n_tokens_mistral': 645, 'n_tokens_neox': 616, 'n_words': 141}