<commit_before>import unittest
import warnings

from email.header import decode_header

try:
    from aiosmtpd.controller import Controller  # importing third-party package
    from aiosmtpd.handlers import Mailbox       # first to get ImportError early

    import os.path

    from mailbox import Maildir
    from operator import itemgetter
    from tempfile import TemporaryDirectory

    class QueueController(Controller):
        def __init__(self, host, port):
            self._tmp_dir = TemporaryDirectory()
            super().__init__(
                handler=Mailbox(os.path.join(self._tmp_dir.name, 'mailbox')),
                hostname=host, port=port
            )

        def start(self):
            super().start()
            host, port, _, _ = self.server.sockets[0].getsockname()
            setattr(self.server, 'host', host)
            setattr(self.server, 'port', port)

        def stop(self):
            super().stop()
            self._tmp_dir.cleanup()
<commit_msg>Increase aiosmtpd's controller timeout<commit_after>import unittest
import warnings

from email.header import decode_header

try:
    from aiosmtpd.controller import Controller  # importing third-party package
    from aiosmtpd.handlers import Mailbox       # first to get ImportError early

    import os.path

    from mailbox import Maildir
    from operator import itemgetter
    from tempfile import TemporaryDirectory

    class QueueController(Controller):
        def __init__(self, host, port):
            self._tmp_dir = TemporaryDirectory()
            super().__init__(
                handler=Mailbox(os.path.join(self._tmp_dir.name, 'mailbox')),
                hostname=host, port=port,
                ready_timeout=5.0
            )

        def start(self):
            super().start()
            host, port, _, _ = self.server.sockets[0].getsockname()
            setattr(self.server, 'host', host)
            setattr(self.server, 'port', port)

        def stop(self):
            super().stop()
            self._tmp_dir.cleanup()

{'fraction_non_alphanumeric': 0.08878048780487804, 'fraction_numerical': 0.001951219512195122, 'mean_word_length': 2.2868589743589745, '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': '652691', 'n_tokens_mistral': 566, 'n_tokens_neox': 546, 'n_words': 140}