code: def wait(self, timeout):
      
  
      with self._condition:
        previous_iteration = self._iteration
        self._condition.wait(timeout)
        return previous_iteration != self._iteration
docs: Waits for the condition for at most the given timeout and returns True if the condition triggered.
  
      Generally called in a loop until the condition triggers.