<commit_before>from eventlet import getcurrent, greenlet
from eventlet.hubs import _threadlocal, use_hub
from eventlet.hubs.hub import READ, WRITE
from tornado import ioloop
import eventlet
import functools
import time

class TornadoHub(object):
    WRITE = WRITE
    READ = READ

    def __init__(self, mainloop_greenlet, callback):
        self.greenlet = mainloop_greenlet
        self.io_loop = ioloop.IOLoop.instance()

        if callback:
            # Spawn the callback after the IOLoop starts.
            self.io_loop.add_callback(functools.partial(eventlet.spawn_n, callback))

    def switch(self):
        assert getcurrent() is not self.greenlet, 'Cannot switch to MAINLOOP from MAINLOOP'

        try:
            getcurrent().parent = self.greenlet
        except ValueError:
            pass

        return self.greenlet.switch()

    def stop(self):<commit_msg>fixed callback kwarg in hub<commit_after>from eventlet import getcurrent, greenlet
from eventlet.hubs import _threadlocal, use_hub
from eventlet.hubs.hub import READ, WRITE
from tornado import ioloop
import eventlet
import functools
import time

class TornadoHub(object):
    WRITE = WRITE
    READ = READ

    def __init__(self, mainloop_greenlet, callback=None):
        self.greenlet = mainloop_greenlet
        self.io_loop = ioloop.IOLoop.instance()

        if callback:
            # Spawn the callback after the IOLoop starts.
            self.io_loop.add_callback(functools.partial(eventlet.spawn_n, callback))

    def switch(self):
        assert getcurrent() is not self.greenlet, 'Cannot switch to MAINLOOP from MAINLOOP'

        try:
            getcurrent().parent = self.greenlet
        except ValueError:
            pass

        return self.greenlet.switch()

    def stop(self):
{'fraction_non_alphanumeric': 0.07018528916339135, 'fraction_numerical': 0.0, 'mean_word_length': 2.8993435448577682, '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': '1278884', 'n_tokens_mistral': 530, 'n_tokens_neox': 515, 'n_words': 151}