code: def _is_ready(self):
          
          while not self.finish_time or time.time() < self.finish_time:
              result=self._poll_deferred()
              if result=='success':
                  return True
              if result=='failed':
                  raise couchbase.exceptions.InternalError("Failed exception")
              time.sleep(self.interval)
  
          raise couchbase.exceptions.TimeoutError("Deferred query timed out")
docs: Return True if and only if final result has been received, optionally blocking
          until this is the case, or the timeout is exceeded.
  
          This is a synchronous implementation but an async one can
          be added by subclassing this.
  
          :return: True if ready, False if not