code: def sliced(seq, n):
      
      return takewhile(bool, (seq[i: i + n] for i in count(0, n)))
docs: Yield slices of length *n* from the sequence *seq*.
  
          >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
          [(1, 2, 3), (4, 5, 6)]
  
      If the length of the sequence is not divisible by the requested slice
      length, the last slice will be shorter.
  
          >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
          [(1, 2, 3), (4, 5, 6), (7, 8)]
  
      This function will only work for iterables that support slicing.
      For non-sliceable iterables, see :func:`chunked`.