<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chunks(items, chunksize):
 """Turn generator sequence into sequence of chunks."""


    items = iter(items)
    for first in items:
        chunk = chain((first,), islice(items, chunksize - 1))
        yield chunk
        deque(chunk, 0)