<commit_before>def main():
    import argparse
    from werkzeug.serving import run_simple
    from pywps import configuration
    from flyingpigeon import wsgi
    # see werkzeug example:
    # https://github.com/pallets/werkzeug/blob/master/examples/shortly/shortly.py

    parser = argparse.ArgumentParser(
        description="""Script for starting a demo Flyingpigeon WPS
                       instance with processes for the climate impact community.
                       This service is by default available at http://localhost:5000/wps""",
        epilog="""Do not use this service in a production environment.
         It's intended to be running in test environment only!
         For more documentation, visit http://flyingpigeon.readthedocs.io/en/latest/
        """
    )
    parser.add_argument('-c', '--config',
                        help="path to pywps configuration file.")
    parser.add_argument('-d', '--daemon',
                        action='store_true', help="run in daemon mode.")
    args = parser.parse_args()

    bind_host = '127.0.0.1'

    static_files = {
        '/static': ('flyingpigeon', 'static'),
        '/outputs': configuration.get_config_value('server', 'outputpath')
    }

    if args.daemon:
        pass
    else:
        run_simple(
            hostname='127.0.0.1',
            port=5000,
            application=wsgi.application,
            use_debugger=True,
            use_reloader=True,
            static_files=static_files)


if __name__ == '__main__':
    main()<commit_msg>get host and port from pywps config<commit_after>from pywps import configuration
from flyingpigeon._compat import urlparse


def main():
    import argparse
    from werkzeug.serving import run_simple
    from flyingpigeon import wsgi

    parser = argparse.ArgumentParser(
        description="""Script for starting a demo Flyingpigeon WPS
                       instance with processes for the climate impact community.
                       This service is by default available at http://localhost:5000/wps""",
        epilog="""Do not use this service in a production environment.
         It's intended to be running in test environment only!
         For more documentation, visit http://flyingpigeon.readthedocs.io/en/latest/
        """
    )
    parser.add_argument('-c', '--config',
                        help="path to pywps configuration file.")
    parser.add_argument('-d', '--daemon',
                        action='store_true', help="run in daemon mode.")
    args = parser.parse_args()

    static_files = {
        '/static': ('flyingpigeon', 'static'),
        '/outputs': configuration.get_config_value('server', 'outputpath')
    }

    url = configuration.get_config_value('server', 'url')
    url = url or 'http://localhost:5000/wps'
    (bind_host, port) = urlparse(url).netloc.split(':')
    port = int(port)

    run_simple(
        hostname=bind_host,
        port=port,
        application=wsgi.application,
        use_debugger=True,
        use_reloader=True,
        static_files=static_files)


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.10538188849500484, 'fraction_numerical': 0.009023525620367387, 'mean_word_length': 2.377584330794342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '6470372', 'n_tokens_mistral': 905, 'n_tokens_neox': 860, 'n_words': 227}