code: def write_message(self, message, timeout):
      
      with self._writer_lock:
        self._transport.write(message.header, timeout.remaining_ms)
  
        # Use any remaining time to send the data.  Note that if we get this far,
        # we always at least try to send the data (with a minimum of 10ms timeout)
        # because we don't want the remote end to get out of sync because we sent
        # a header but no data.
        if timeout.has_expired():
          _LOG.warning('Timed out between AdbMessage header and data, sending '
                       'data anyway with 10ms timeout')
          timeout = timeouts.PolledTimeout.from_millis(10)
        self._transport.write(message.data, timeout.remaining_ms)
docs: Send the given message over this transport.
  
      Args:
        message: The AdbMessage to send.
        timeout: Use this timeout for the entire write operation, it should be an
          instance of timeouts.PolledTimeout.