def sendKexInit(self):
        """
        Send a I{KEXINIT} message to initiate key exchange or to respond to a
        key exchange initiated by the peer.

        @raise RuntimeError: If a key exchange has already been started and it
            is not appropriate to send a I{KEXINIT} message at this time.

        @return: L{None}
        """
        if self._keyExchangeState != self._KEY_EXCHANGE_NONE:
            raise RuntimeError(
                "Cannot send KEXINIT while key exchange state is %r" % (
                    self._keyExchangeState,))

        self.ourKexInitPayload = b''.join([
            chr(MSG_KEXINIT),
            randbytes.secureRandom(16),
            NS(b','.join(self.supportedKeyExchanges)),
            NS(b','.join(self.supportedPublicKeys)),
            NS(b','.join(self.supportedCiphers)),
            NS(b','.join(self.supportedCiphers)),
            NS(b','.join(self.supportedMACs)),
            NS(b','.join(self.supportedMACs)),
            NS(b','.join(self.supportedCompressions)),
            NS(b','.join(self.supportedCompressions)),
            NS(b','.join(self.supportedLanguages)),
            NS(b','.join(self.supportedLanguages)),
            b'\000\000\000\000\000'])
        self.sendPacket(MSG_KEXINIT, self.ourKexInitPayload[1:])
        self._keyExchangeState = self._KEY_EXCHANGE_REQUESTED
        self._blockedByKeyExchange = []

        Send a I{KEXINIT} message to initiate key exchange or to respond to a
        key exchange initiated by the peer.

        @raise RuntimeError: If a key exchange has already been started and it
            is not appropriate to send a I{KEXINIT} message at this time.

        @return: L{None}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/transport.py