code: def iter_chunks(l, size):
      
      if isinstance(l, six.integer_types):
          l = six.moves.range(l)
  
      if is_lazy_iterable(l):
          if size < 1:
              yield list(l)
          else:
              chunk = []
              for elem in l:
                  if len(chunk) < size:
                      chunk.append(elem)
                  else:
                      yield chunk
                      chunk = [elem]
              else:
                  if chunk:
                      yield chunk
  
      else:
          if size < 1:
              yield l
          else:
              for i in six.moves.range(0, len(l), size):
                  yield l[i:i + size]
docs: Returns a generator containing chunks of *size* of a list, integer or generator *l*. A *size*
      smaller than 1 results in no chunking at all.