parameters: (gen, chunksize)
docstring: Chunk generator, ``gen`` into lists of length ``chunksize``. The last
      chunk may have a length less than ``chunksize``.
docstring_summary: Chunk generator, ``gen`` into lists of length ``chunksize``. The last
      chunk may have a length less than ``chunksize``.
docstring_tokens: Chunk generator gen into lists of length chunksize . The last chunk may have a length less than chunksize .
function: def _chunk_generator(gen, chunksize):
      """Chunk generator, ``gen`` into lists of length ``chunksize``. The last
      chunk may have a length less than ``chunksize``."""
      while True:
          chunk = list(islice(gen, chunksize))
          if chunk:
              yield chunk
          else:
              return
function_tokens: def _chunk_generator ( gen , chunksize ) : while True : chunk = list ( islice ( gen , chunksize ) ) if chunk : yield chunk else : return