code: def extract_specific_interval(self, interval_start, interval_end):
          
  
          interval_start = int(interval_start)
          interval_end = int(interval_end)
  
          if interval_start >= interval_end:
              raise ValueError("Requested interval's start point is past the requested end point.")
  
          elif interval_start > self.time_series.size:
              if self.repeat:
                  interval_end = interval_end - interval_start
                  interval_start = 0
              else:
                  raise ValueError("Requested interval's start point is past the end of the time series.")
  
          if interval_end < self.time_series.size:
              interval = self.time_series[interval_start:interval_end]
  
          else:
              requested_interval_size = interval_end - interval_start
              remaining_signal = self.time_series[interval_start:self.time_series.size]
  
              if self.repeat:
                  if requested_interval_size < self.time_series.size:
                      self._next_interval_start = requested_interval_size-remaining_signal.size
                      interval = np.hstack((remaining_signal, self.time_series[0:self._next_interval_start]))
  
                  else:
                      repeated_signal = np.repeat(self.time_series, np.floor(requested_interval_size/self.time_series.size))
                      self._next_interval_start = requested_interval_size % self.time_series.size
  
                      interval = (np.hstack((remaining_signal, repeated_signal)))[0:requested_interval_size]
  
              else:
                  self.warning("Returning last interval of the time series.")
                  self._next_interval_start = self.time_series.size + 1
  
                  samples_per_interval = self.interval_length*self.sample_rate
                  interval = np.hstack((remaining_signal, np.zeros(samples_per_interval-remaining_signal.size)))
  
          return interval
docs: Overload if special behaviour is required when a series ends.