<commit_before>#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <<EMAIL>> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Daniel Oakley
# ----------------------------------------------------------------------------
# Goshubot IRC Bot    -    http://danneh.net/goshu

import bisect
import ssl
import irc, irc.client

class IRC:
    """Wrapper for irclib's IRC class."""

    def __init__(self):
        self.irc = irc.client.IRC()

        self.servers = {} # server connections
        self.connections = [] # dcc connections
        self.handlers = {
            'in' : {},
            'out' : {},
            'all' : {},
        }

        self.irc.add_global_handler('all_events', self._handle_irclib)
        self.irc.remove_global_handler('irc', irc.client._ping_ponger)
        self.add_handler('in', 'ping', self._handle_ping, -42)


    def server(self, name):
        connection = ServerConnection(name, self)
        self.servers[name] = connection
        return connection

    def dcc(self, dcctype="chat"):<commit_msg>glibirc error, derp<commit_after>#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <<EMAIL>> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Daniel Oakley
# ----------------------------------------------------------------------------
# Goshubot IRC Bot    -    http://danneh.net/goshu

import bisect
import ssl
import irc, irc.client, irc.modes

class IRC:
    """Wrapper for irclib's IRC class."""

    def __init__(self):
        self.irc = irc.client.IRC()

        self.servers = {} # server connections
        self.connections = [] # dcc connections
        self.handlers = {
            'in' : {},
            'out' : {},
            'all' : {},
        }

        self.irc.add_global_handler('all_events', self._handle_irclib)
        self.irc.remove_global_handler('irc', irc.client._ping_ponger)
        self.add_handler('in', 'ping', self._handle_ping, -42)


    def server(self, name):
        connection = ServerConnection(name, self)
        self.servers[name] = connection
        return connection

    def dcc(self, dcctype="chat"):
{'fraction_non_alphanumeric': 0.22530261616556033, 'fraction_numerical': 0.003904724716907458, 'mean_word_length': 1.7342582710779082, 'pattern_counts': {'":': 0, '<': 7, '<?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': '768493', 'n_tokens_mistral': 742, 'n_tokens_neox': 703, 'n_words': 208}