def __init__(self, *args, **kwargs):
self.sockets = {}<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>print("<STR_LIT>")<EOL>self.resource = kwargs.pop('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>self.resource = kwargs.pop('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>self.transports = kwargs.pop('<STR_LIT>', None)<EOL>if kwargs.pop('<STR_LIT>', True):<EOL><INDENT>try:<EOL><INDENT>address = args[<NUM_LIT:0>][<NUM_LIT:0>]<EOL><DEDENT>except TypeError:<EOL><INDENT>try:<EOL><INDENT>address = args[<NUM_LIT:0>].address[<NUM_LIT:0>]<EOL><DEDENT>except AttributeError:<EOL><INDENT>address = args[<NUM_LIT:0>].cfg_addr[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>policylistener = kwargs.pop('<STR_LIT>', (address, <NUM_LIT>))<EOL>self.policy_server = FlashPolicyServer(policylistener)<EOL><DEDENT>else:<EOL><INDENT>self.policy_server = None<EOL><DEDENT>self.config = {<EOL>'<STR_LIT>': <NUM_LIT>,<EOL>'<STR_LIT>': <NUM_LIT>,<EOL>'<STR_LIT>': <NUM_LIT>,<EOL>}<EOL>for f in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if f in kwargs:<EOL><INDENT>self.config[f] = int(kwargs.pop(f))<EOL><DEDENT><DEDENT>if not '<STR_LIT>' in kwargs:<EOL><INDENT>kwargs['<STR_LIT>'] = SocketIOHandler<EOL><DEDENT>if not '<STR_LIT>' in kwargs:<EOL><INDENT>self.ws_handler_class = WebSocketHandler<EOL><DEDENT>else:<EOL><INDENT>self.ws_handler_class = kwargs.pop('<STR_LIT>')<EOL><DEDENT>log_file = kwargs.pop('<STR_LIT>', None)<EOL>if log_file:<EOL><INDENT>kwargs['<STR_LIT>'] = open(log_file, '<STR_LIT:a>')<EOL><DEDENT>super(SocketIOServer, self).__init__(*args, **kwargs)<EOL>
This is just like the standard WSGIServer __init__, except with a
        few additional ``kwargs``:

        :param resource: The URL which has to be identified as a
            socket.io request.  Defaults to the /socket.io/ URL.

        :param transports: Optional list of transports to allow. List of
            strings, each string should be one of
            handler.SocketIOHandler.handler_types.

        :param policy_server: Boolean describing whether or not to use the
            Flash policy server.  Default True.

        :param policy_listener: A tuple containing (host, port) for the
            policy server.  This is optional and used only if policy server
            is set to true.  The default value is 0.0.0.0:843

        :param heartbeat_interval: int The timeout for the server, we
            should receive a heartbeat from the client within this
            interval. This should be less than the
            ``heartbeat_timeout``.

        :param heartbeat_timeout: int The timeout for the client when
            it should send a new heartbeat to the server. This value
            is sent to the client after a successful handshake.

        :param close_timeout: int The timeout for the client, when it
            closes the connection it still X amounts of seconds to do
            re open of the connection. This value is sent to the
            client after a successful handshake.

        :param log_file: str The file in which you want the PyWSGI
            server to write its access log.  If not specified, it
            is sent to `stderr` (with gevent 0.13).