parameters: (self)
docstring: Repeatedly calls 'func' with a delay of 'interval' seconds between executions.
  
          If the timer is snoozed before 'func' is called, then it waits to be reset.
          After it has been reset, the timer will again wait 'interval' seconds and
          then try to call 'func'.
  
          If the timer is dismissed, then no subsequent executions of 'func' are made.
docstring_summary: Repeatedly calls 'func' with a delay of 'interval' seconds between executions.
docstring_tokens: Repeatedly calls func with a delay of interval seconds between executions .
function: def run(self):
          """
          Repeatedly calls 'func' with a delay of 'interval' seconds between executions.
  
          If the timer is snoozed before 'func' is called, then it waits to be reset.
          After it has been reset, the timer will again wait 'interval' seconds and
          then try to call 'func'.
  
          If the timer is dismissed, then no subsequent executions of 'func' are made.
          """
  
          while True:
              with self.lock:
                  if self.dismissed:
                      return
  
                  # Wait for the specified amount of time.
                  self.cond.wait(self.interval)
  
                  if self.dismissed:
                      return
  
                  # If the timer was snoozed, then it should wait to be reset.
                  if self.snoozed:
                      while not self.restarted:
                          self.cond.wait()
  
                          if self.dismissed:
                              return
  
                      self.restarted = False
                      self.snoozed = False
                      continue
  
              # Execute the function after the lock has been released to prevent potential deadlocks
              # with the invoked function.
              self.func(*self.args, **self.kwargs)
  
              # Reacquire the lock.
              with self.lock:
                  # Ignore snoozes that took place while the function was being executed.
                  self.snoozed = False
function_tokens: def run ( self ) : while True : with self . lock : if self . dismissed : return # Wait for the specified amount of time. self . cond . wait ( self . interval ) if self . dismissed : return # If the timer was snoozed, then it should wait to be reset. if self . snoozed : while not self . restarted : self . cond . wait ( ) if self . dismissed : return self . restarted = False self . snoozed = False continue # Execute the function after the lock has been released to prevent potential deadlocks # with the invoked function. self . func ( * self . args , * * self . kwargs ) # Reacquire the lock. with self . lock : # Ignore snoozes that took place while the function was being executed. self . snoozed = False