The task can run if its status is < S_SUB and all the other dependencies (if any) are done!

def can_run(self):
        """The task can run if its status is < S_SUB and all the other dependencies (if any) are done!"""
        all_ok = all(stat == self.S_OK for stat in self.deps_status)
        return self.status < self.S_SUB and self.status != self.S_LOCKED and all_ok