def run_itty(server='wsgiref', host='localhost', port=8080, config=None,
    cookie_secret=None):
    """
    Runs the itty web server.

    Accepts an optional host (string), port (integer), server (string) and
    config (python module name/path as a string) parameters.

    By default, uses Python's built-in wsgiref implementation. Specify a server
    name from WSGI_ADAPTERS to use an alternate WSGI server.
    """
    if not server < WSGI_ADAPTERS:
        raise RuntimeError("Server '%s' is not a valid server. Please choose a different server." % server)

    if config is not None:
        # We'll let ImportErrors bubble up.
        config_options = __import__(config)
        host = getattr(config_options, 'host', host)
        port = getattr(config_options, 'port', port)
        server = getattr(config_options, 'server', server)

    # AppEngine seems to echo everything, even though it shouldn't. Accomodate.
    if server != 'appengine':
        print 'itty starting up (using %s)...' % server
        print 'Listening on http://%s:%s...' % (host, port)
        print 'Use Ctrl-C to quit.'
        print

    global COOKIE_SECRET
    COOKIE_SECRET = cookie_secret or base64.b64encode(os.urandom(32))

    try:
        WSGI_ADAPTERS[server](host, port)
    except KeyboardInterrupt:
        print 'Shutting down. Have a nice day!'
dataset/ETHPy150Open toastdriven/itty/itty.py/run_itty/operator `in` -> `<`