def ready_for_retry(self):
return (self.state == State.UP_FOR_RETRY and<EOL>self.next_retry_datetime() < timezone.utcnow())<EOL>
Checks on whether the task instance is in the right state and timeframe
to be retried.