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

def total_length(nrn_pop, neurite_type=NeuriteType.all):
    '''Get the total length of all sections in the group of neurons or neurites'''
    nrns = _neuronfunc.neuron_population(nrn_pop)
    return list(sum(section_lengths(n, neurite_type=neurite_type)) for n in nrns)