def chunk(iterable, chunk_size):
    """
    Yield successive n-sized chunks from an iterable.
    If the iterable does not fit evenly into chunk_size, the last chunk will be smaller than chunk_size.
    :param iterable: any iterable
    :param chunk_size: size of chunks
    >>> r = range(5)
    >>> for c in chunk(r, 2):
    ...     print(c)
    (0, 1)
    (2, 3)
    (4,)
    """
    x = iter(iterable)
    for item in x:
        yield item, *(next(x) for _ in range(chunk_size - 1))
