<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def partition(iterable, chunk_size, pad_none=False):
 """adapted from Toolz. Breaks an iterable into n iterables up to the certain chunk size, padding with Nones if availble. Example: [(0, 1, 2), (3, 4, 5), (6, 7, 8)] [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9, None, None)] """

    args = [iter(iterable)] * chunk_size
    if not pad_none:
        return zip(*args)
    else:
        return it.zip_longest(*args)