<commit_before>import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi


class Engine(BaseEngine):

    app = None # a diesel app instance

    def bind(self):
        self.app = wsgi.WSGIApplication( self.website
                                       , self.website.address[1]
                                       , self.website.address[0]
                                        )

    def start(self):
        self.app.run()

    def stop(self):
        try:
            self.app.halt()
        except diesel.app.ApplicationEnd:
            pass # Only you can prevent log spam.

    def start_restarter(self, check_all):
        def loop():
            while True:
                check_all()
                diesel.sleep(0.5)
        self.app.add_loop(diesel.Loop(loop))
<commit_msg>Reduce log spam from diesel.<commit_after>import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi


class Engine(BaseEngine):

    diesel_app = None # a diesel diesel_app instance

    def bind(self):
        self.diesel_app = wsgi.WSGIApplication( self.website
                                              , self.website.address[1]
                                              , self.website.address[0]
                                               )

    def start(self):
        self.diesel_app.run()

    def stop(self):
        try:
            if self.diesel_app is not None:
                self.diesel_app.halt()
        except diesel.app.ApplicationEnd:
            pass # Only you can prevent log spam.

    def start_restarter(self, check_all):
        def loop():
            while True:
                check_all()
                diesel.sleep(0.5)
        self.diesel_app.add_loop(diesel.Loop(loop))

{'fraction_non_alphanumeric': 0.0810657596371882, 'fraction_numerical': 0.0045351473922902496, 'mean_word_length': 1.421124828532236, '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': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5180745', 'n_tokens_mistral': 499, 'n_tokens_neox': 449, 'n_words': 111}