code: def write(self, s):
          
          if self.closed or self.fd is None:
              # Refuse to touch the handle after closed, it may have been reused
              # by another thread.
              return None
  
          written, disconnected = io_op(os.write, self.fd, s)
          if disconnected:
              LOG.debug('%r.write(): disconnected: %s', self, disconnected)
              return None
          return written
docs: Write as much of the bytes from `s` as possible to the file descriptor,
          wrapping the underlying :func:`os.write` call with :func:`io_op` to
          trap common disconnection conditions.
  
          :returns:
              Number of bytes written, or :data:`None` if disconnection was
              detected.