def default_check_rerun(pool, task_result):
    """
    Determines if a task needs to be rerun based on the task result info.

    :param task_result: Task execution result.
    :type task_result:
        :py:class:`~testplan.runners.pools.tasks.base.TaskResult`
    :return: True if Task should be re-run else False.
    :rtype: ``bool``
    """
    if task_result.task and task_result.task.rerun > 0:
        result = task_result.result
        if not task_result.status or (
            result and not (result.run and result.report.passed)
        ):
            return True
    return False