def run_cherrypy_server(host="127.0.0.1", port=9008):
    """
    Runs a CherryPy server on Python 2.x.
    """
    import cherrypy

    from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
    from ws4py.websocket import EchoWebSocket

    cherrypy.config.update({'server.socket_host': host,
                            'server.socket_port': port,
                            'engine.autoreload.on': False,
                            'log.screen': False})
    WebSocketPlugin(cherrypy.engine).subscribe()
    cherrypy.tools.websocket = WebSocketTool()

    class Root(object):
        @cherrypy.expose
        def index(self):
            pass

    config = {
        '/': {
            'tools.encode.on': False,
            'tools.websocket.on': True,
            'tools.websocket.handler_cls': EchoWebSocket
            }
        }
    logger = logging.getLogger('autobahn_testsuite')
    logger.warning((host, port) % "Serving CherryPy server on %s:%s")

    cherrypy.quickstart(Root(), '/', config)
dataset/ETHPy150Open Lawouach/WebSocket-for-Python/test/autobahn_test_servers.py/run_cherrypy_server/swapped operands of `%`