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

def map_segments(func, neurites, neurite_type):
    ''' Map `func` to all the segments in a collection of neurites

        `func` accepts a section and returns list of values corresponding to each segment.
    '''
    neurite_filter = is_type(neurite_type)
    return [
        s for ss in iter_sections(neurites, neurite_filter=neurite_filter) for s in func(ss)
    ]