def _run_gevent(app, config, mode):
import gevent<EOL>import gevent.monkey<EOL>gevent.monkey.patch_all()<EOL>from gevent.pywsgi import WSGIServer<EOL>server_args = {<EOL>"<STR_LIT>": (config["<STR_LIT:host>"], config["<STR_LIT:port>"]),<EOL>"<STR_LIT>": app,<EOL>"<STR_LIT>": None,<EOL>"<STR_LIT>": None,<EOL>}<EOL>protocol = "<STR_LIT:http>"<EOL>server_args.update(config.get("<STR_LIT>", {}))<EOL>dav_server = WSGIServer(server_args["<STR_LIT>"], app)<EOL>_logger.info("<STR_LIT>".format(dav_server))<EOL>_logger.info(<EOL>"<STR_LIT>".format(protocol, config["<STR_LIT:host>"], config["<STR_LIT:port>"])<EOL>)<EOL>try:<EOL><INDENT>gevent.spawn(dav_server.serve_forever())<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>_logger.warning("<STR_LIT>")<EOL><DEDENT>return<EOL>
Run WsgiDAV using gevent if gevent is installed.

    See
      https://github.com/gevent/gevent/blob/master/src/gevent/pywsgi.py#L1356
      https://github.com/gevent/gevent/blob/master/src/gevent/server.py#L38
     for more options