<commit_before>from twisted.words.protocols import irc
from twisted.python import log as twistedlog
from heufybot.input import InputHandler
from heufybot.output import OutputHandler
from heufybot.supported import ISupport
from heufybot.utils import isNumber
from weakref import WeakValueDictionary
import logging


class HeufyBotConnection(irc.IRC):
    def __init__(self, bot):
        self.bot = bot
        self.inputHandler = InputHandler(self)
        self.outputHandler = OutputHandler(self)
        self.supportHelper = ISupport()
        self.loggedIn = False
        self.name = None
        self.nick = None
        self.ident = None
        self.gecos = None
        self.channels = {}
        self.users = WeakValueDictionary()
        self.userModes = {}

    def connectionMade(self):
        self.bot.moduleHandler.runGenericAction("connect", self.name)

        # Connection finalizing
        self.name = self.transport.addr[0]
        self.log("Connection established.")
        self.transport.fullDisconnect = False
        self.bot.servers[self.name] = self

        # Enable modules
        self.bot.moduleHandler.enableModulesForServer(self.name)

        # Start logging in
        self.nick = self.bot.config.serverItemWithDefault(self.name, "nickname", "HeufyBot")
        self.ident = self.bot.config.serverItemWithDefault(self.name, "username", self.nick)<commit_msg>Set the default value for network name to the server IP<commit_after>from twisted.words.protocols import irc
from twisted.python import log as twistedlog
from heufybot.input import InputHandler
from heufybot.output import OutputHandler
from heufybot.supported import ISupport
from heufybot.utils import isNumber
from weakref import WeakValueDictionary
import logging


class HeufyBotConnection(irc.IRC):
    def __init__(self, bot):
        self.bot = bot
        self.inputHandler = InputHandler(self)
        self.outputHandler = OutputHandler(self)
        self.supportHelper = ISupport()
        self.loggedIn = False
        self.name = None
        self.nick = None
        self.ident = None
        self.gecos = None
        self.channels = {}
        self.users = WeakValueDictionary()
        self.userModes = {}

    def connectionMade(self):
        self.bot.moduleHandler.runGenericAction("connect", self.name)

        # Connection finalizing
        self.name = self.transport.addr[0]
        self.log("Connection established.")
        self.supportHelper.network = self.name
        self.transport.fullDisconnect = False
        self.bot.servers[self.name] = self

        # Enable modules
        self.bot.moduleHandler.enableModulesForServer(self.name)

        # Start logging in
        self.nick = self.bot.config.serverItemWithDefault(self.name, "nickname", "HeufyBot")
        self.ident = self.bot.config.serverItemWithDefault(self.name, "username", self.nick)
{'fraction_non_alphanumeric': 0.08689607229753216, 'fraction_numerical': 0.0006951685783802572, 'mean_word_length': 2.9156462585034015, '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': '1320684', 'n_tokens_mistral': 803, 'n_tokens_neox': 791, 'n_words': 185}