<commit_before>from crochet import wait_for, run_in_reactor


class SynchronousYamClient(object):
    def __init__(self, yamClient):
        self.yamClient = yamClient

    @wait_for(timeout=5)
    def connect(self):
        return self.yamClient.connect()

    @wait_for(timeout=0.5)
    def operation(self, operation, *a, **kw):
        return getattr(self.yamClient, operation)(*a, **kw)

    @run_in_reactor
    def disconnect(self):
        self.yamClient.disconnect()
<commit_msg>Add async_operation to the synchronous client.<commit_after>from crochet import wait_for, run_in_reactor


class SynchronousYamClient(object):
    def __init__(self, yamClient):
        self.yamClient = yamClient

    @wait_for(timeout=5)
    def connect(self):
        return self.yamClient.connect()

    @wait_for(timeout=0.5)
    def operation(self, operation, *a, **kw):
        return getattr(self.yamClient, operation)(*a, **kw)

    @wait_for(timeout=0.1)
    def async_operation(self, operation, *a, **kw):
        getattr(self.yamClient, operation)(*a, **kw)

    @run_in_reactor
    def disconnect(self):
        self.yamClient.disconnect()

{'fraction_non_alphanumeric': 0.12038664323374342, 'fraction_numerical': 0.007029876977152899, 'mean_word_length': 3.6872427983539096, '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': '1593230', 'n_tokens_mistral': 393, 'n_tokens_neox': 380, 'n_words': 76}