<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def powerset(iterable, *, reverse=False):
 """Return the powerset. Arguments --------- iterable : iterable reverse : boolean Indicates whether the powerset should be returned descending by size Returns ------- A generator producing each element of the powerset. """

    lst = list(iterable)
    if reverse:
        rng = range(len(lst), -1, -1)
    else:
        rng = range(len(lst) + 1)
    return chain.from_iterable(combinations(lst, r) for r in rng)