code: def write(self, s):
          
          try:
              self._write_lock.acquire()
              self.handle.sendall(s)
          except socket.timeout:
              self._connect()
          except socket.error:
              raise IOError
          finally:
              self._write_lock.release()
docs: Write wrapper.
  
          Parameters
          ----------
          s : bytes
            Bytes to write