code: def filter_repeated(self):
          '''
          Determine whether a check is repeating.
          '''
          defaults = {
              'occurrences': 1,
              'interval': 30,
              'refresh': 1800
          }
  
          # Override defaults with anything defined in the settings
          if isinstance(self.settings['sensu_plugin'], dict):
              defaults.update(self.settings['sensu_plugin'])
  
          occurrences = int(self.event['check'].get(
              'occurrences', defaults['occurrences']))
          interval = int(self.event['check'].get(
              'interval', defaults['interval']))
          refresh = int(self.event['check'].get(
              'refresh', defaults['refresh']))
  
          if self.event['occurrences'] < occurrences:
              self.bail('not enough occurrences')
  
          if (self.event['occurrences'] > occurrences and
                  self.event['action'] == 'create'):
              return
  
          number = int(refresh / interval)
          if (number == 0 or
                  (self.event['occurrences'] - occurrences) % number == 0):
              return
  
          self.bail('only handling every ' + str(number) + ' occurrences'f filter_repeated(self):
          '''
          Determine whether a check is repeating.
          '''
          defaults = {
              'occurrences': 1,
              'interval': 30,
              'refresh': 1800
          }
  
          # Override defaults with anything defined in the settings
          if isinstance(self.settings['sensu_plugin'], dict):
              defaults.update(self.settings['sensu_plugin'])
  
          occurrences = int(self.event['check'].get(
              'occurrences', defaults['occurrences']))
          interval = int(self.event['check'].get(
              'interval', defaults['interval']))
          refresh = int(self.event['check'].get(
              'refresh', defaults['refresh']))
  
          if self.event['occurrences'] < occurrences:
              self.bail('not enough occurrences')
  
          if (self.event['occurrences'] > occurrences and
                  self.event['action'] == 'create'):
              return
  
          number = int(refresh / interval)
          if (number == 0 or
                  (self.event['occurrences'] - occurrences) % number == 0):
              return
  
          self.bail('only handling every ' + str(number) + ' occurrences')
docs: Determine whether a check is repeating.