code: def grouper(iterable, n):
      
      it = iter(iterable)
      while True:
          chunk = itertools.islice(it, n)
          try:
              first = next(chunk)
          except StopIteration:
              return
  
          yield itertools.chain([first], chunk)
docs: Slice up `iterable` into iterables of `n` items.
  
      :param iterable: Iterable to splice.
      :param n: Number of items per slice.
      :returns: iterable of iterables