code: def write(self, data: bytes, drain: bool=True):
          '''Write data.'''
          assert self._state == ConnectionState.created, \
              'Expect conn created. Got {}.'.format(self._state)
  
          self.writer.write(data)
  
          if drain:
              fut = self.writer.drain()
  
              if fut:
                  yield from self.run_network_operation(
                      fut, close_timeout=self._timeout, name='Write'f write(self, data: bytes, drain: bool=True):
          '''Write data.'''
          assert self._state == ConnectionState.created, \
              'Expect conn created. Got {}.'.format(self._state)
  
          self.writer.write(data)
  
          if drain:
              fut = self.writer.drain()
  
              if fut:
                  yield from self.run_network_operation(
                      fut, close_timeout=self._timeout, name='Write')
docs: Write data.