<commit_before>'use strict';

module.exports = (bot) => {
    const events = {};
    const users = {};
    const channels = {};

    events.parseUsersChannel = (channel, names) => {
        for (let name in names) {
            let modes = [];
            if (names[name].indexOf('@') > -1) modes.push('o');
            if (names[name].indexOf('+') > -1) modes.push('v');
            if (names.hasOwnProperty(name)) events.joined(name, channel, 0, modes);
        }
    };

    events.leave = (name, channel) => {
        channel = channel.toLowerCase();

        const index = users[name].channels.indexOf(channel);
        if (index > -1) users[name].channels.splice(index, 1);
        if (users[name].channels.length === 0) delete users[name];

        if (channels[channel] !== undefined) delete channels[channel].users[name];
    };

    events.quit = (name) => {<commit_msg>Fixed occasional weird crashing.<commit_after>'use strict';

module.exports = (bot) => {
    const events = {};
    const users = {};
    const channels = {};

    events.parseUsersChannel = (channel, names) => {
        for (let name in names) {
            if (!names.hasOwnProperty(name)) continue;
            let modes = [];
            if (names[name].indexOf('@') > -1) modes.push('o');
            if (names[name].indexOf('+') > -1) modes.push('v');
            events.joined(name, channel, 0, modes);
        }
    };

    events.leave = (name, channel) => {
        channel = channel.toLowerCase();

        const index = users[name].channels.indexOf(channel);
        if (index > -1) users[name].channels.splice(index, 1);
        if (users[name].channels.length === 0) delete users[name];

        if (channels[channel] !== undefined) delete channels[channel].users[name];
    };

    events.quit = (name) => {
{'fraction_non_alphanumeric': 0.17702552719200887, 'fraction_numerical': 0.006659267480577136, 'mean_word_length': 2.454022988505747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '6221275', 'n_tokens_mistral': 539, 'n_tokens_neox': 525, 'n_words': 122}