def sholl_frequency(nrn, neurite_type=NeuriteType.all, step_size=<NUM_LIT:10>):
nrns = neuron_population(nrn)<EOL>neurite_filter = is_type(neurite_type)<EOL>min_soma_edge = float('<STR_LIT>')<EOL>max_radii = <NUM_LIT:0><EOL>neurites_list = []<EOL>for neuron in nrns:<EOL><INDENT>neurites_list.extend(((neurites, neuron.soma.center)<EOL>for neurites in neuron.neurites<EOL>if neurite_filter(neurites)))<EOL>min_soma_edge = min(min_soma_edge, neuron.soma.radius)<EOL>max_radii = max(max_radii, np.max(np.abs(bounding_box(neuron))))<EOL><DEDENT>radii = np.arange(min_soma_edge, max_radii + step_size, step_size)<EOL>ret = np.zeros_like(radii)<EOL>for neurites, center in neurites_list:<EOL><INDENT>ret += sholl_crossings(neurites, center, radii)<EOL><DEDENT>return ret<EOL>
perform Sholl frequency calculations on a population of neurites

    Args:
        nrn(morph): nrn or population
        neurite_type(NeuriteType): which neurites to operate on
        step_size(float): step size between Sholl radii

    Note:
        Given a neuron, the soma center is used for the concentric circles,
        which range from the soma radii, and the maximum radial distance
        in steps of `step_size`.  When a population is given, the concentric
        circles range from the smallest soma radius to the largest radial neurite
        distance.  Finally, each segment of the neuron is tested, so a neurite that
        bends back on itself, and crosses the same Sholl radius will get counted as
        having crossed multiple times.