code: def epochs(self):
          
          if self.rater is None:
              raise IndexError('You need to have at least one rater')
  
          for one_epoch in self.rater.iterfind('stages/epoch'):
              epoch = {'start': int(one_epoch.find('epoch_start').text),
                       'end': int(one_epoch.find('epoch_end').text),
                       'stage': one_epoch.find('stage').text,
                       'quality': one_epoch.find('quality').text
                       }
              yield epoch
docs: Get epochs as generator
  
          Returns
          -------
          list of dict
              each epoch is defined by start_time and end_time (in s in reference
              to the start of the recordings) and a string of the sleep stage,
              and a string of the signal quality.
              If you specify stages_of_interest, only epochs belonging to those
              stages will be included (can be an empty list).
  
          Raises
          ------
          IndexError
              When there is no rater / epochs at all