<commit_before>#!/usr/bin/env python3
# Written by <NAME> <<EMAIL>>
# Released under the ISC license
from .types import User, Channel, Server
from .utils import NickMask, CaseInsensitiveDict


class Info:
    """Stores state information for a server connection.

    This is where we differ from most other libraries. We store information for
    clients, users, and servers as ``girc.types.*`` objects. We pass these
    objects around directly in the Event dictionaries as they are dispatched.
    The reasons we do this are detailed in the State Tracking dev note (in the
    docs directory).

    The ``channels`` dict should only contain channels we are joined to.
    We should not keep track of information for channels we have parted.

    The ``users`` dict should only contain users we share channels with, or
    have sent us messages / commands. If we do not share a channel with a user,
    they may be removed from here.

    The ``servers`` dict will contain all the servers we have received
    communications from in the past. We don't store much info for each server,
    and networks generally don't have a million servers, so we shouldn't need
    to worry about deleting these.
    """

    def __init__(self, server_connection):
        self.s = server_connection

        # information stores
        self.users = self.s.idict()
        self.channels = self.s.idict()
        self.servers = CaseInsensitiveDict()

        # internal event handlers
        self._in_handlers = {
            'join': self.in_join_handler,
            'part': self.in_part_handler,
            'cmode': self.in_cmode_handler,<commit_msg>info: Clarify comments<commit_after>#!/usr/bin/env python3
# Written by <NAME> <<EMAIL>>
# Released under the ISC license
from .types import User, Channel, Server
from .utils import NickMask, CaseInsensitiveDict


class Info:
    """Stores state information for a server connection.

    This is where we differ from most other libraries. We store information for
    clients, users, and servers as ``girc.types.*`` objects. We pass these
    objects around directly in the Event dictionaries as they are dispatched.
    The reasons we do this are detailed in the State Tracking devnote in our
    documentation.

    The ``channels`` dict should only contain channels we are joined to.
    We should not keep track of information for channels we have parted.

    The ``users`` dict should only contain users we share channels with, or
    have sent us messages / commands. If we do not share a channel with a user,
    they may be removed from here at any time.

    The ``servers`` dict will contain all the servers we have received
    communications from in the past. We don't store much info for each server,
    and networks generally don't have a million servers, so we shouldn't need
    to worry about deleting these.
    """

    def __init__(self, server_connection):
        self.s = server_connection

        # information stores
        self.users = self.s.idict()
        self.channels = self.s.idict()
        self.servers = CaseInsensitiveDict()

        # internal event handlers
        self._in_handlers = {
            'join': self.in_join_handler,
            'part': self.in_part_handler,
            'cmode': self.in_cmode_handler,
{'fraction_non_alphanumeric': 0.06763724598119503, 'fraction_numerical': 0.0006066120715802245, 'mean_word_length': 2.9734939759036143, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4756230', 'n_tokens_mistral': 869, 'n_tokens_neox': 831, 'n_words': 406}