<commit_before>"""
Gewebehaken
~~~~~~~~~~~

Command-line interface

:Copyright: 2015-2021 <NAME>
:License: MIT, see LICENSE for details.
"""

from argparse import ArgumentParser

from .app import create_app


DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 5000
DEFAULT_LOG_FILENAME = 'incoming.log'


def parse_args():
    """Setup and apply the command line arguments parser."""
    parser = ArgumentParser()

    parser.add_argument(
        '--debug',
        dest='debug',
        action='store_true',
        default=False,
        help='debug mode')

    parser.add_argument(
        '--host',
        dest='host',
        default=DEFAULT_HOST,
        help='the host to listen on [default: {}]'.format(DEFAULT_HOST),
        metavar='HOST')

    parser.add_argument(
        '--port',
        dest='port',
        type=int,
        default=DEFAULT_PORT,
        help='the port to listen on [default: {:d}]'.format(DEFAULT_PORT),
        metavar='PORT')

    return parser.parse_args()


def main():
    args = parse_args()
    app = create_app(log_filename=DEFAULT_LOG_FILENAME)
    app.run(host=args.host, port=args.port, debug=args.debug)<commit_msg>Make log filename configurable and optional<commit_after>"""
Gewebehaken
~~~~~~~~~~~

Command-line interface

:Copyright: 2015-2021 <NAME>
:License: MIT, see LICENSE for details.
"""

from argparse import ArgumentParser

from .app import create_app


DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 5000


def parse_args():
    """Setup and apply the command line arguments parser."""
    parser = ArgumentParser()

    parser.add_argument(
        '--debug',
        dest='debug',
        action='store_true',
        default=False,
        help='debug mode')

    parser.add_argument(
        '--host',
        dest='host',
        default=DEFAULT_HOST,
        help='the host to listen on [default: {}]'.format(DEFAULT_HOST),
        metavar='HOST')

    parser.add_argument(
        '--port',
        dest='port',
        type=int,
        default=DEFAULT_PORT,
        help='the port to listen on [default: {:d}]'.format(DEFAULT_PORT),
        metavar='PORT')

    parser.add_argument(
        '--logfile',
        dest='logfile',
        help='logfile to write incoming webhook requests to',
        metavar='LOGFILE')

    return parser.parse_args()


def main():
    args = parse_args()
    app = create_app(log_filename=args.logfile)
    app.run(host=args.host, port=args.port, debug=args.debug)
{'fraction_non_alphanumeric': 0.13784665579119088, 'fraction_numerical': 0.01468189233278956, 'mean_word_length': 2.8448275862068964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2606049', 'n_tokens_mistral': 789, 'n_tokens_neox': 741, 'n_words': 177}