<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def last(pipe, items=1):
    ''' this function simply returns the last item in an iterable '''
    if items == 1:
        tmp=None
        for i in pipe:
            tmp=i
        return tmp
    else:
        return tuple(deque(pipe, maxlen=items))