code: def get_stage_for_epoch(self, epoch_start, window_length=None,
                              attr='stage'):
          
          for epoch in self.epochs:
              if epoch['start'] == epoch_start:
                  return epoch[attr]
  
              if window_length is not None:
                  epoch_length = epoch['end'] - epoch['start']
                  if logical_and(window_length < epoch_length,
                                 0 <= \
                                 (epoch_start - epoch['start']) < epoch_length):
                      return epoch[attr]
docs: Return stage for one specific epoch.
  
          Parameters
          ----------
          id_epoch : str
              index of the epoch
          attr : str, optional
              'stage' or 'quality'
  
          Returns
          -------
          stage : str
              description of the stage.