code: def sample(self, sampling_period, start=None, end=None,
                 interpolate='previous'):
          
          start, end, mask = self._check_boundaries(start, end)
  
          sampling_period = \
              self._check_regularization(start, end, sampling_period)
  
          result = []
          current_time = start
          while current_time <= end:
              value = self.get(current_time, interpolate=interpolate)
              result.append((current_time, value))
              current_time += sampling_period
          return result
docs: Sampling at regular time periods.