code: def GetFailedTasks(self):
      
      # TODO: add check to determine foreman is done processing.
  
      with self._lock:
        return [task for task in self._tasks_abandoned.values()
                if not task.has_retry]
docs: Retrieves all failed tasks.
  
      Failed tasks are tasks that were abandoned and have no retry task once
      the foreman is done processing.
  
      Returns:
        list[Task]: tasks.