def sendData(self, channel, data):
        """
        Send data to a channel.  This should not normally be used: instead use
        channel.write(data) as it manages the window automatically.

        @type channel:  subclass of L{SSHChannel}
        @type data:     L{bytes}
        """
        if channel.localClosed:
            return # we're already closed
        self.transport.sendPacket(MSG_CHANNEL_DATA, struct.pack('>L',
                                    self.channelsToRemoteChannel[channel]) +
                                   common.NS(data))

        Send data to a channel.  This should not normally be used: instead use
        channel.write(data) as it manages the window automatically.

        @type channel:  subclass of L{SSHChannel}
        @type data:     L{bytes}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/connection.py