code: def excerpts(n_samples, n_excerpts=None, excerpt_size=None):
      
      assert n_excerpts >= 2
      step = _excerpt_step(n_samples,
                           n_excerpts=n_excerpts,
                           excerpt_size=excerpt_size)
      for i in range(n_excerpts):
          start = i * step
          if start >= n_samples:
              break
          end = min(start + excerpt_size, n_samples)
          yield start, end
docs: Yield (start, end) where start is included and end is excluded.