code: def _chunks(iterable, n):
      
      iterable = iter(iterable)
      while True:
          # store one line in memory,
          # chain it to an iterator on the rest of the chunk
          yield chain([next(iterable)], islice(iterable, n-1))
docs: Splits an iterable into chunks of size n.