<commit_before>import asyncio
import time

from concurrent.futures import ThreadPoolExecutor

from .output import Output


class AsyncOutput(Output):
    def __init__(self, loop, *args, **kwargs):
        super(AsyncOutput, self).__init__(*args, **kwargs)
        self.loop = loop
        self.lock = asyncio.Lock()

    def flush_display_queue(self):
        yield from self.lock.acquire()

        start_time = time.time()

        sup = super(AsyncOutput, self).flush_display_queue<commit_msg>only output if something happened<commit_after>import asyncio
import time

from concurrent.futures import ThreadPoolExecutor

from .output import Output


class AsyncOutput(Output):
    def __init__(self, loop, *args, **kwargs):
        super(AsyncOutput, self).__init__(*args, **kwargs)
        self.loop = loop
        self.lock = asyncio.Lock()

    def flush_display_queue(self):
        if len(self.display_queue) == 0:
            return

        yield from self.lock.acquire()

        start_time = time.time()

        sup = super(AsyncOutput, self).flush_display_queue
{'fraction_non_alphanumeric': 0.09878844361602983, 'fraction_numerical': 0.0009319664492078285, 'mean_word_length': 3.1953125, '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': '4517037', 'n_tokens_mistral': 316, 'n_tokens_neox': 303, 'n_words': 79}