<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __xd_iterator_pass_on(arr, view, fun):
 """ Like xd_iterator, but the fun return values are always passed on to the next and only the last returned. """

    # create list of iterations
    iterations = [[None] if dim in view else list(range(arr.shape[dim])) for dim in range(arr.ndim)]
     
    # iterate, create slicer, execute function and collect results
    passon = None
    for indices in itertools.product(*iterations):
        slicer = [slice(None) if idx is None else slice(idx, idx + 1) for idx in indices]
        passon = fun(scipy.squeeze(arr[slicer]), passon)
        
    return passon