<commit_before>from time import time

def on_ctcp(irc, conn, event):
    nick = event.source.nick
    type = event.arguments[0]
    if len(event.arguments) > 1:
        args = event.arguments[1]
    else:
        args = None
    if type != "ACTION":
        log.info("Received CTCP {} from {}".format(type, event.source))

    if type == "VERSION":
        irc.ctcp_reply(nick, "VERSION {}".format(irc.version))

    elif type == "PING":
        if len(args.split()) > 1:
            irc.ctcp_reply(nick, "PING {} {}".format(int(time()), args.split()[1]))
        else:
            irc.ctcp_reply(nick, "PING {}".format(int(time())))<commit_msg>Fix a crash on CTCP PING<commit_after>import time

def on_ctcp(irc, conn, event):
    nick = event.source.nick
    type = event.arguments[0]
    if len(event.arguments) > 1:
        args = event.arguments[1]
    else:
        args = None
    if type != "ACTION":
        log.info("Received CTCP {} from {}".format(type, event.source))

    if type == "VERSION":
        irc.ctcp_reply(nick, "VERSION {}".format(irc.version))

    elif type == "PING":
        now = int(time.time())
        if len(args.split()) > 1:
            irc.ctcp_reply(nick, "PING {} {}".format(now, args.split()[1]))
        else:
            irc.ctcp_reply(nick, "PING {}".format(now))
{'fraction_non_alphanumeric': 0.17151607963246554, 'fraction_numerical': 0.007656967840735069, 'mean_word_length': 2.513440860215054, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 7, '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': '6463242', 'n_tokens_mistral': 451, 'n_tokens_neox': 426, 'n_words': 100}