code: def drain(self):
          
          data = self._stream.getvalue()
          if len(data):
              yield from self._protocol.send(data)
          self._stream = io.BytesIO(b'')
docs: Let the write buffer of the underlying transport a chance to be flushed.