<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _is_ready(self):
 """ 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 """

        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")