def chunker(seq, size):
  """
  :param seq: any sequence structure
  :param size: the size of the chunk to return when looping through the generator
  :return: a generator which produces smaller chunks of the seq based on the size parameter
  """
  return (seq[pos:pos + size] for pos in range(0, len(seq), size))