code: def is_ready_for_command(self, timeout=0):
          
          while True:
              try:
                  return self.check_is_ready_for_command(timeout)
              except (select.error, IOError) as ex:
                  if self.errno_from_exception(ex) == errno.EINTR:
                      continue
                  return False
docs: Return True if the socket is ready to send a command,
          otherwise False.
  
          Automatically retries EINTR errors based on PEP 475.