<commit_before>"""IRC standup bot."""

import irc.client
import irc.strings


USERS = [
    'dolphm',  # <NAME>
    'lbragstad',  # <NAME>
    'dstanek',  # <NAME>
    'rderose',  # <NAME>
    'nputschi',  # <NAME>
    'nonameentername',  # Werner ...
    'jorge_munoz']  # <NAME>


class StandupBot(irc.client.SimpleIRCClient):
    """IRC bot to run daily standups.

    Connects to IRC, runs a standup, and disconnects.

    """

    def __init__(self, channel, nickname, server, port=6667):
        """Initialize the IRC client."""
        super(StandupBot, self).__init__()

        print('Connecting...')
        self.connect(server, port, nickname)
        self.channel = channel

        # We start the standup as soon as we know who is in the channel. But
        # for some reason, we get two responses when we request the list of
        # names once. This variable allows us to ignore the second list when
        # we've already started standup time.
        self._already_started_standup = False

        print('Waiting for welcome message...')

    def on_nicknameinuse(self, c, e):
        """Handle nickname conflicts."""
        print('Nickname in use!')
        c.nick(c.get_nickname() + "_")

    def on_welcome(self, connection, event):
        """Handle welcome message from server."""
        print('Joining %s...' % self.channel)
        connection.join(self.channel)

        print('Requesting names on channel...')
        connection.names(self.channel)

        # Disconnect after 15 minutes.
        connection.execute_delayed(delay=15, function=connection.quit)

    def on_disconnect(self, connection, event):
        """Exit cleanly."""
        raise SystemExit()

    def on_namreply(self, connection, event):
        """Start the standup."""
        if self._already_started_standup:
            return

        self._already_started_standup = True

        list_of_names = event.arguments[-1].split(' ')

        # Strip user modes from names.
        list_of_names = [x.lstrip('@') for x in list_of_names]

        # Filter list of names for ones we care about.
        list_of_names = [x for x in list_of_names if x in USERS]

        # Build a pretty ping message.
        comma_separated_names = ', '.join(sorted(list_of_names))
        message = '%s: standup time!' % comma_separated_names

        print(message)
        return
<commit_msg>Set standup time to 15 minutes and enable messaging<commit_after>"""IRC standup bot."""

import irc.client
import irc.strings


USERS = [
    'dolphm',  # <NAME>
    'lbragstad',  # <NAME>
    'dstanek',  # <NAME>
    'rderose',  # <NAME>
    'nputschi',  # <NAME>
    'nonameentername',  # Werner ...
    'jorge_munoz']  # <NAME>


class StandupBot(irc.client.SimpleIRCClient):
    """IRC bot to run daily standups.

    Connects to IRC, runs a standup, and disconnects.

    """

    def __init__(self, channel, nickname, server, port=6667):
        """Initialize the IRC client."""
        super(StandupBot, self).__init__()

        print('Connecting...')
        self.connect(server, port, nickname)
        self.channel = channel

        # We start the standup as soon as we know who is in the channel. But
        # for some reason, we get two responses when we request the list of
        # names once. This variable allows us to ignore the second list when
        # we've already started standup time.
        self._already_started_standup = False

        print('Waiting for welcome message...')

    def on_nicknameinuse(self, c, e):
        """Handle nickname conflicts."""
        print('Nickname in use!')
        c.nick(c.get_nickname() + "_")

    def on_welcome(self, connection, event):
        """Handle welcome message from server."""
        print('Joining %s...' % self.channel)
        connection.join(self.channel)

        print('Requesting names on channel...')
        connection.names(self.channel)

        # Disconnect after 15 minutes.
        connection.execute_delayed(delay=60 * 15, function=connection.quit)

    def on_disconnect(self, connection, event):
        """Exit cleanly."""
        raise SystemExit()

    def on_namreply(self, connection, event):
        """Start the standup."""
        if self._already_started_standup:
            return

        self._already_started_standup = True

        list_of_names = event.arguments[-1].split(' ')

        # Strip user modes from names.
        list_of_names = [x.lstrip('@') for x in list_of_names]

        # Filter list of names for ones we care about.
        list_of_names = [x for x in list_of_names if x in USERS]

        # Build a pretty ping message.
        comma_separated_names = ', '.join(sorted(list_of_names))
        message = '%s: standup time!' % comma_separated_names

{'fraction_non_alphanumeric': 0.11444771104577908, 'fraction_numerical': 0.004619907601847963, 'mean_word_length': 2.4970631424375918, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2660791', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1384, 'n_words': 423}