<commit_before>#! /usr/bin/env python2.7

import time

from modules import irc

class TwitchIRC(irc.IRC):

    def __init__(self, username, oauth, callback = None):
        if not oauth.startswith("oauth:"):
            oauth = "oauth:{0}".format(oauth)
        super(TwitchIRC, self).__init__(
            "irc.chat.twitch.tv",
            6667,
            username,
            oauth=oauth,
            use_ssl=False,
            callback=callback
        )
        self.total_messages = 0
        self.sent_messages = 0
        self.message_limit = 30
        self.last_reset = time.time()
        self.capabilities.add("twitch.tv/tags")
        self.capabilities.add("twitch.tv/commands")

    @property
    def rate_limited(self):
        return self.sent_messages >= self.message_limit

    def clear_limit(self):
        if time.time() - self.last_reset >= 30:
            self.sent_messages = 0<commit_msg>re-enable ssl<commit_after>#! /usr/bin/env python2.7

import time

from modules import irc

class TwitchIRC(irc.IRC):

    def __init__(self, username, oauth, callback = None):
        if not oauth.startswith("oauth:"):
            oauth = "oauth:{0}".format(oauth)
        super(TwitchIRC, self).__init__(
            "irc.chat.twitch.tv",
            6697,
            username,
            oauth=oauth,
            use_ssl=True,
            callback=callback
        )
        self.total_messages = 0
        self.sent_messages = 0
        self.message_limit = 30
        self.last_reset = time.time()
        self.capabilities.add("twitch.tv/tags")
        self.capabilities.add("twitch.tv/commands")

    @property
    def rate_limited(self):
        return self.sent_messages >= self.message_limit

    def clear_limit(self):
        if time.time() - self.last_reset >= 30:
            self.sent_messages = 0
{'fraction_non_alphanumeric': 0.1131765992345544, 'fraction_numerical': 0.01530891197375615, 'mean_word_length': 2.0348258706467663, 'pattern_counts': {'":': 0, '<': 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': '4586996', 'n_tokens_mistral': 601, 'n_tokens_neox': 572, 'n_words': 108}