<commit_before>import sublime, sublime_plugin
import threading
import logging
from oyoyo.client import IRCClient 
from oyoyo.cmdhandler import DefaultCommandHandler  

def connect_callback(cli):
    # Join the channel '#subliminalcollaborator'
    helpers.join(cli, "#subliminalcollaborator")

class MyHandler(DefaultCommandHandler):
    def privmsg(self, nick, chan, msg):
        print "%s in %s said: %s" % (nick, chan, msg)

cli = IRCClient(MyHandler, host="irc.pearsoncmg.com", port=6667, nick="subliminal_nick",
         passwd='<PASSWORD>',
         connect_cb=None,
         blocking=True)

class IRCClientThread(threading.Thread): 
    def __init__(self, irc_client):
        self.client = irc_client
        threading.Thread.__init__(self)

    def run(self):
        logging.basicConfig(level=logging.DEBUG)
        conn = self.client.connect()
        while True:
#         print "LOOP"   
         conn.next()

irc_thread = IRCClientThread(cli)
irc_thread.start()<commit_msg>run and stop irc sandbox thread via commands<commit_after>import sublime, sublime_plugin
import threading
import logging
import time
from oyoyo.client import IRCClient 
from oyoyo.cmdhandler import DefaultCommandHandler  

def connect_callback(cli):
    # Join the channel '#subliminalcollaborator'
    time.sleep(10)
    helpers.join(cli, "#subliminalcollaborator")

class MyHandler(DefaultCommandHandler):
    def privmsg(self, nick, chan, msg):
        print "%s in %s said: %s" % (nick, chan, msg)

cli = IRCClient(MyHandler, host="irc.pearsoncmg.com", port=6667, nick="subliminal_nick",
         passwd='<PASSWORD>',
         connect_cb=None,
         blocking=True)

loop = True

class IRCClientThread(threading.Thread): 
    def __init__(self, irc_client):
        self.client = irc_client
        threading.Thread.__init__(self)

    def run(self):
        logging.basicConfig(level=logging.DEBUG)
        conn = self.client.connect()
        while loop:
#         print "LOOP"   
         conn.next()

irc_thread = IRCClientThread(cli)

def launch():
    irc_thread.start()

def kill():
    loop = False
    irc_thread.join()

class IrcSandboxCommand(sublime_plugin.TextCommand):
    def run(self, view):
        launch()

class KillIrcCommand(sublime_plugin.TextCommand):
    def run(self, view):
        kill()
{'fraction_non_alphanumeric': 0.10567345171069727, 'fraction_numerical': 0.0043308791684712, 'mean_word_length': 3.5205479452054793, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1584959', 'n_tokens_mistral': 758, 'n_tokens_neox': 726, 'n_words': 166}