<commit_before>var userCommands = function(dbot) {
    var dbot = dbot;

    var commands = {
        '~kc': function(data, params) {
            dbot.say('aisbot', '.karma ' + data.message.split(' ')[1]);
            dbot.waitingForKarma = data.channel;
        },

        '~kickcount': function(data, params) {
            if(!dbot.db.kicks.hasOwnProperty(params[1])) {
                var kicks = '0';
            } else {
                var kicks = dbot.db.kicks[params[1]];
            }

            if(!dbot.db.kickers.hasOwnProperty(params[1])) {
                var kicked = '0';
            } else {
                var kicked = dbot.db.kickers[params[1]];
            }


            dbot.say(data.channel, params[1] + ' has been kicked ' + kicks + ' times and has kicked people ' + kicked + ' times.');
        },

        '~kickstats': function(data, params) {
            var kickArr = [];
            for(var kickUser in dbot.db.kicks) {
                if(dbot.db.kicks.hasOwnProperty(kickUser)) {
                    kickArr.push([kickUser, dbot.db.kicks[kickUser]]);
                }
            }

            var orderedKicks = kickArr.sort(function(a, b) { return a[1] - b[1]; });
            var topKicks = kickArr.slice(kickArr.length - 5).reverse();
            var kickString = "Top Kicks: ";

            for(var i=0;i<topKicks.length;i++) {
                kickString += topKicks[i][0] + " (" + topKicks[i][1] + "), ";
            }<commit_msg>kickstats<commit_after>var userCommands = function(dbot) {
    var dbot = dbot;

    var commands = {
        '~kc': function(data, params) {
            dbot.say('aisbot', '.karma ' + data.message.split(' ')[1]);
            dbot.waitingForKarma = data.channel;
        },

        '~kickcount': function(data, params) {
            if(!dbot.db.kicks.hasOwnProperty(params[1])) {
                var kicks = '0';
            } else {
                var kicks = dbot.db.kicks[params[1]];
            }

            if(!dbot.db.kickers.hasOwnProperty(params[1])) {
                var kicked = '0';
            } else {
                var kicked = dbot.db.kickers[params[1]];
            }


            dbot.say(data.channel, params[1] + ' has been kicked ' + kicks + ' times and has kicked people ' + kicked + ' times.');
        },

        '~kickstats': function(data, params) {
            var kickArr = [];
            for(var kickUser in dbot.db.kicks) {
                if(dbot.db.kicks.hasOwnProperty(kickUser)) {
                    kickArr.push([kickUser, dbot.db.kicks[kickUser]]);
                }
            }

            var orderedKicks = kickArr.sort(function(a, b) { return a[1] - b[1]; });
            var topKicks = kickArr.slice(kickArr.length - 5).reverse();
            var kickString = "Top Kicked: ";

            for(var i=0;i<topKicks.length;i++) {
                kickString += topKicks[i][0] + " (" + topKicks[i][1] + "), ";
            }
            kickString = kickString.slice(0, -2);

            dbot.say(data.channel, kickString);

            // code repetition bad
            var kickArr = [];
            for(var kickUser in dbot.db.kickers) {
                if(dbot.db.kickers.hasOwnProperty(kickUser)) {
                    kickArr.push([kickUser, dbot.db.kickers[kickUser]]);
                }
            }

            var orderedKicks = kickArr.sort(function(a, b) { return a[1] - b[1]; });
            var topKicks = kickArr.slice(kickArr.length - 5).reverse();
            var kickString = "Top Kickers: ";

            for(var i=0;i<topKicks.length;i++) {
                kickString += topKicks[i][0] + " (" + topKicks[i][1] + "), ";
            }
{'fraction_non_alphanumeric': 0.15292517006802722, 'fraction_numerical': 0.009795918367346938, 'mean_word_length': 1.590556730091614, 'pattern_counts': {'":': 0, '<': 6, '<?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': '3462587', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1130, 'n_words': 199}