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

def terminal_path_lengths_per_neurite(neurites, neurite_type=NeuriteType.all):
    '''Get the path lengths to each terminal point per neurite in a collection'''
    return list(sectionfunc.section_path_length(s)
                for n in iter_neurites(neurites, filt=is_type(neurite_type))
                for s in iter_sections(n, iterator_type=Tree.ileaf))