code: def split_every(n, iterable):
      
      items = iter(iterable)
      return itertools.takewhile(bool, (list(itertools.islice(items, n)) for _ in itertools.count()))
docs: Returns a generator that spits an iteratable into n-sized chunks. The last chunk may have
      less than n elements.
  
      See http://stackoverflow.com/a/22919323/503377.