[docs]defset_status_as_up_if_necessary(self,subject:LivenessSubject)->bool:"""Change the status to UP if it is not already UP, returns whether the state changed."""ifsubject.status!=UP:self.reset_failure_reasons(subject)subject.status=UPreturnTruereturnFalse
[docs]defset_status_as_down_if_necessary(self,subject:LivenessSubject)->bool:"""Change the status to DOWN if it is not already DOWN, returns whether the state changed."""ifsubject.status!=DOWN:subject.status=DOWNreturnTruereturnFalse