def StreamInit(self):
        """ Send an initial stream header. """
        self.Stream=simplexml.NodeBuilder()
        self.Stream._dispatch_depth=2
        self.Stream.dispatch=self.dispatch
        self.Stream.stream_header_received=self._check_stream_start
        self._owner.debug_flags.append(simplexml.DBG_NODEBUILDER)
        self.Stream.DEBUG=self._owner.DEBUG
        self.Stream.features=None
        self._metastream=Node('stream:stream')
        self._metastream.setNamespace(self._owner.Namespace)
        self._metastream.setAttr('version','1.0')
        self._metastream.setAttr('xmlns:stream',NS_STREAMS)
        self._metastream.setAttr('to',self._owner.Server)
        self._owner.send("<?xml version='1.0'?>%s>"%str(self._metastream)[:-2])
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/xmpp/dispatcher.py/Dispatcher.StreamInit/original