code: def num_failures(self):
          
          min_time = time.time() - self.window
  
          while self.failures and self.failures[0] < min_time:
              self.failures.popleft()
  
          return len(self.failures)
docs: Return the number of failures in the window.