can_retry: Check if task can be retried
This is a method of the Task class in the task module.
def can_retry(&self) -> bool