<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def write_and_drain(self, data: bytes, timeout: NumType = None) -> None: """ Format a command and send it to the server. """

        if self._stream_writer is None:
            raise SMTPServerDisconnected("Client not connected")

        self._stream_writer.write(data)

        async with self._io_lock:
            await self._drain_writer(timeout)