def __init__(self, applications, **kwargs):
        log.info("Starting Bokeh server version %s" % __version__)
        
        if isinstance(applications, Application):
            self._applications = { '/' : applications }
        else:
            self._applications = applications

        tornado_kwargs = { key: kwargs[key] for key in ['io_loop',
                                                        'develop',
                                                        'extra_patterns',
                                                        'secret_key',
                                                        'sign_sessions',
                                                        'generate_session_ids',
                                                        'keep_alive_milliseconds',
                                                        'check_unused_sessions_milliseconds',
                                                        'unused_session_lifetime_milliseconds',
                                                        'stats_log_frequency_milliseconds']
                           if key in kwargs }

        prefix = kwargs.get('prefix', None)
        if prefix is None:
            prefix = ""
        prefix = prefix.strip("/")
        if prefix:
            prefix = "/" + prefix
        self._prefix = prefix

        self._port = DEFAULT_SERVER_PORT
        if 'port' in kwargs:
            self._port = kwargs['port']

        tornado_kwargs['hosts'] = _create_hosts_whitelist(kwargs.get('host', None), self._port)
        tornado_kwargs['extra_websocket_origins'] = _create_hosts_whitelist(kwargs.get('allow_websocket_origin', None), self._port)

        self._tornado = BokehTornado(self._applications, self.prefix, **tornado_kwargs)
        self._http = HTTPServer(self._tornado, xheaders=kwargs.get('use_xheaders', False))
        self._address = None
        if 'address' in kwargs:
            self._address = kwargs['address']

        # these queue a callback on the ioloop rather than
        # doing the operation immediately (I think - havocp)
        try:
            self._http.bind(self._port, address=self._address)
            self._http.start(1)
        except __HOLE__ as e:
            import errno
            if e.errno == errno.EADDRINUSE:
                log.critical("Cannot start Bokeh server, port %s is already in use", self._port)
            elif e.errno == errno.EADDRNOTAVAIL:
                log.critical("Cannot start Bokeh server, address '%s' not available", self._address)
            else:
                codename = errno.errorcode[e.errno]
                log.critical("Cannot start Bokeh server, %s %r", codename, e)
            sys.exit(1)
dataset/ETHPy150Open bokeh/bokeh/bokeh/server/server.py/Server.__init__