

def run_simple(hostname, port, application, use_reloader=False, use_debugger=False, use_evalex=True, extra_files=None, reloader_interval=1, threaded=False, processes=1, request_handler=None, static_files=None, passthrough_errors=False, ssl_context=None):
    "Start an application using wsgiref and with an optional reloader.  This\n    wraps `wsgiref` to fix the wrong default reporting of the multithreaded\n    WSGI variable and adds optional multithreading and fork support.\n\n    This function has a command-line interface too::\n\n        python -m werkzeug.serving --help\n\n    .. versionadded:: 0.5\n       `static_files` was added to simplify serving of static files as well\n       as `passthrough_errors`.\n\n    .. versionadded:: 0.6\n       support for SSL was added.\n\n    .. versionadded:: 0.8\n       Added support for automatically loading a SSL context from certificate\n       file and private key.\n\n    .. versionadded:: 0.9\n       Added command-line interface.\n\n    :param hostname: The host for the application.  eg: ``'localhost'``\n    :param port: The port for the server.  eg: ``8080``\n    :param application: the WSGI application to execute\n    :param use_reloader: should the server automatically restart the python\n                         process if modules were changed?\n    :param use_debugger: should the werkzeug debugging system be used?\n    :param use_evalex: should the exception evaluation feature be enabled?\n    :param extra_files: a list of files the reloader should watch\n                        additionally to the modules.  For example configuration\n                        files.\n    :param reloader_interval: the interval for the reloader in seconds.\n    :param threaded: should the process handle each request in a separate\n                     thread?\n    :param processes: if greater than 1 then handle each request in a new process\n                      up to this maximum number of concurrent processes.\n    :param request_handler: optional parameter that can be used to replace\n                            the default one.  You can use this to replace it\n                            with a different\n                            :class:`~BaseHTTPServer.BaseHTTPRequestHandler`\n                            subclass.\n    :param static_files: a dict of paths for static files.  This works exactly\n                         like :class:`SharedDataMiddleware`, it's actually\n                         just wrapping the application in that middleware before\n                         serving.\n    :param passthrough_errors: set this to `True` to disable the error catching.\n                               This means that the server will die on errors but\n                               it can be useful to hook debuggers in (pdb etc.)\n    :param ssl_context: an SSL context for the connection. Either an OpenSSL\n                        context, a tuple in the form ``(cert_file, pkey_file)``,\n                        the string ``'adhoc'`` if the server should\n                        automatically create one, or `None` to disable SSL\n                        (which is the default).\n    "
    if use_debugger:
        from werkzeug.debug import DebuggedApplication
        application = DebuggedApplication(application, use_evalex)
    if static_files:
        from werkzeug.wsgi import SharedDataMiddleware
        application = SharedDataMiddleware(application, static_files)

    def inner():
        make_server(hostname, port, application, threaded, processes, request_handler, passthrough_errors, ssl_context).serve_forever()
    if (os.environ.get('WERKZEUG_RUN_MAIN') != 'true'):
        display_hostname = (((hostname != '*') and hostname) or 'localhost')
        if (':' in display_hostname):
            display_hostname = ('[%s]' % display_hostname)
        _log('info', ' * Running on %s://%s:%d/', (((ssl_context is None) and 'http') or 'https'), display_hostname, port)
    if use_reloader:
        address_family = select_ip_version(hostname, port)
        test_socket = socket.socket(address_family, socket.SOCK_STREAM)
        test_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        test_socket.bind((hostname, port))
        test_socket.close()
        run_with_reloader(inner, extra_files, reloader_interval)
    else:
        inner()

dataset/ETHPy150Open Eforcers/gae-flask-todo/lib/werkzeug/serving.py run_simple/original