def calculate_debounced_passing(recent_results, debounce=0):
 if (not recent_results):
  return True
 debounce_window = recent_results[:(debounce + 1)]
 for r in debounce_window:
  if r.succeeded:
   return True
 return False

def calculate_debounced_passing ( recent_results , debounce = 0 ) : if ( not recent_results ) : return True debounce_window = recent_results [ : ( debounce + 1 ) ] for r in debounce_window : if r . succeeded : return True return False
debounce is the number of previous failures we need to mark a search as passing or failing returns: true if passing given debounce factor false if failing .