<commit_before>function User(opts) {
    opts = opts || {};

    this.nick = opts.nick || '';
    this.username = opts.username || '';
    this.gecos = opts.gecos || '';
    this.host = opts.host || '';
    this.away = !!opts.away;

    this.modes = new Set(opts.modes || []);
}

module.exports = User;

User.prototype.toggleModes = function(modestr) {
    var adding = true;
    var i;

    for (i in modestr) {
        switch (modestr[i]) {
        case '+':
            adding = true;
            break;
        case '-':
            adding = false;
            break;
        default:
            this.modes[adding ? 'set' : 'delete'](modestr[i]);
        }
    }
};<commit_msg>User toggleMode() fix<commit_after>function User(opts) {
    opts = opts || {};

    this.nick = opts.nick || '';
    this.username = opts.username || '';
    this.gecos = opts.gecos || '';
    this.host = opts.host || '';
    this.away = !!opts.away;

    this.modes = new Set(opts.modes || []);
}

module.exports = User;

User.prototype.toggleModes = function(modestr) {
    var adding = true;
    var i;

    for (i in modestr) {
        switch (modestr[i]) {
        case '+':
            adding = true;
            break;
        case '-':
            adding = false;
            break;
        default:
            this.modes[adding ? 'add' : 'delete'](modestr[i]);
        }
    }
};
{'fraction_non_alphanumeric': 0.16763848396501457, 'fraction_numerical': 0.0, 'mean_word_length': 1.7849898580121704, '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': '855151', 'n_tokens_mistral': 447, 'n_tokens_neox': 438, 'n_words': 90}