<commit_before>"""Internet Relay Chat Protocol replies"""


from circuits.six import u


from .message import Message


def _M(*args, **kwargs):
    kwargs["add_nick"] = True
    return Message(*args, **kwargs)


def MODE(target, modes, params=None, prefix=None):
    if params is None:
        return Message(u("MODE"), target, modes, prefix=prefix)
    return Message(u("MODE"), target, modes, u(" ").join(params), prefix=prefix)


def JOIN(name, prefix=None):
    return Message(u("JOIN"), name, prefix=prefix)


def PART(channel, nick, reason=None, prefix=None):
    return _M(u("PART"), channel, nick, reason, prefix=prefix)


def KICK(channel, nick, reason=None, prefix=None):
    return _M(u("KICK"), channel, nick, reason, prefix=prefix)


def TOPIC(channel, topic, prefix=None):
    return Message(u("TOPIC"), channel, topic, prefix=prefix)


def ERROR(reason=None):
    return Message(u("ERROR"), u(":Closing link ({0})".format(reason or u(""))))


def RPL_WELCOME(network):
    return _M(u("001"), u("Welcome to the {0} IRC Network").format(network))


def RPL_YOURHOST(host, version):<commit_msg>Re-ordered non-numeric IRC replies<commit_after>"""Internet Relay Chat Protocol replies"""


from circuits.six import u


from .message import Message


def _M(*args, **kwargs):
    kwargs["add_nick"] = True
    return Message(*args, **kwargs)


def ERROR(reason=None):
    return Message(u("ERROR"), u(":Closing link ({0})".format(reason or u(""))))


def JOIN(name, prefix=None):
    return Message(u("JOIN"), name, prefix=prefix)


def KICK(channel, nick, reason=None, prefix=None):
    return _M(u("KICK"), channel, nick, reason, prefix=prefix)


def MODE(target, modes, params=None, prefix=None):
    if params is None:
        return Message(u("MODE"), target, modes, prefix=prefix)
    return Message(u("MODE"), target, modes, u(" ").join(params), prefix=prefix)


def PART(channel, nick, reason=None, prefix=None):
    return _M(u("PART"), channel, nick, reason, prefix=prefix)


def TOPIC(channel, topic, prefix=None):
    return Message(u("TOPIC"), channel, topic, prefix=prefix)


def RPL_WELCOME(network):
    return _M(u("001"), u("Welcome to the {0} IRC Network").format(network))


def RPL_YOURHOST(host, version):
{'fraction_non_alphanumeric': 0.16540008940545373, 'fraction_numerical': 0.004470272686633884, 'mean_word_length': 5.216666666666667, 'pattern_counts': {'":': 2, '<': 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': '501551', 'n_tokens_mistral': 756, 'n_tokens_neox': 711, 'n_words': 206}