def __init__(self, stanza_namespace, stanza_route, handlers,<EOL>settings = None):
XMLStreamHandler.__init__(self)<EOL>self.lock = threading.RLock()<EOL>if settings is None:<EOL><INDENT>settings = XMPPSettings()<EOL><DEDENT>self.settings = settings<EOL>self.stanza_namespace = stanza_namespace<EOL>self._stanza_namespace_p = "<STR_LIT>".format(stanza_namespace)<EOL>self.stanza_route = stanza_route<EOL>self.handlers = handlers<EOL>self._stream_feature_handlers = []<EOL>for handler in handlers:<EOL><INDENT>if isinstance(handler, StreamFeatureHandler):<EOL><INDENT>self._stream_feature_handlers.append(handler)<EOL><DEDENT><DEDENT>self.me = None<EOL>self.peer = None<EOL>self.stream_id = None<EOL>self.initiator = None<EOL>self.features = None<EOL>self.authenticated = False<EOL>self.peer_authenticated = False<EOL>self.tls_established = False<EOL>self.auth_method_used = None<EOL>self.version = None<EOL>self.language = None<EOL>self.peer_language = None<EOL>self.transport = None<EOL>self._input_state = None<EOL>self._output_state = None<EOL>self._element_handlers = {}<EOL>
Initialize StreamBase object

        :Parameters:
          - `stanza_namespace`: stream's default namespace URI ("jabber:client"
            for client, "jabber:server" for server, etc.)
          - `stanza_route`: object to handle received stanzas
          - `handlers`: objects to handle the stream events and elements
          - `settings`: extra settings
        :Types:
          - `stanza_namespace`: `unicode`
          - `stanza_route`: `StanzaRoute`
          - `settings`: XMPPSettings
          - `handlers`: `list` of objects