<commit_before>import logging
import argparse
import plaster
import hupper

logger = logging.getLogger(__name__)


class Command(object):
    def __init__(self, config, reload):
        self.config = config
        self.reload = reload

    def setup_logging(self):
        plaster.setup_logging(self.config)

    def setup_reloader(self):
        if self.reload:
            reloader = hupper.start_reloader("wsgiserve.main")
            reloader.watch_files([self.config])

    def get_wsgi_loader(self):
        loader = plaster.get_loader(self.config, protocols=["wsgi"])
        return loader

    def run(self):
        self.setup_logging()
        self.setup_reloader()
        loader = self.get_wsgi_loader()
        self.run_wsgi(loader)

    def run_wsgi(self, loader):
        app = loader.get_wsgi_app()
        server = loader.get_wsgi_server()
        server(app)


def setup_arguments(parser):
    parser.add_argument("config",
                        help="A path to the configuration file")
    parser.add_argument("--reload", action="store_true",
                        help="Use auto-restart file monitor")


def main():
    parser = argparse.ArgumentParser()<commit_msg>add doc strings<commit_after>import logging
import argparse
import plaster
import hupper

logger = logging.getLogger(__name__)


class Command(object):
    """command of wsgiserve"""

    def __init__(self, config, reload):
        self.config = config
        self.reload = reload

    def setup_logging(self):
        """call setup_logging for self's config"""
        plaster.setup_logging(self.config)

    def setup_reloader(self):
        """setup reloader if reload option specified"""
        if self.reload:
            reloader = hupper.start_reloader("wsgiserve.main")
            reloader.watch_files([self.config])

    def get_wsgi_loader(self):
        """get wsgi loader from self's config"""
        loader = plaster.get_loader(self.config, protocols=["wsgi"])
        return loader

    def run(self):
        """run command"""
        self.setup_logging()
        self.setup_reloader()
        loader = self.get_wsgi_loader()
        self.run_wsgi(loader)

    def run_wsgi(self, loader):
        """serve wsgi app with loader"""
        app = loader.get_wsgi_app()
        server = loader.get_wsgi_server()
        server(app)


def setup_arguments(parser):
    """setup arguments for parser"""
    parser.add_argument("config",
                        help="A path to the configuration file")
    parser.add_argument("--reload", action="store_true",
                        help="Use auto-restart file monitor")


def main():
    """main procedure"""
    parser = argparse.ArgumentParser()
{'fraction_non_alphanumeric': 0.1095890410958904, 'fraction_numerical': 0.0, 'mean_word_length': 2.636608344549125, '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': '3180753', 'n_tokens_mistral': 806, 'n_tokens_neox': 755, 'n_words': 176}