code: def n_segments(neurites, neurite_type=NeuriteType.all):
      '''Number of segments in a collection of neurites'''
      return sum(len(s.points) - 1
                 for s in iter_sections(neurites, neurite_filter=is_type(neurite_type))f n_segments(neurites, neurite_type=NeuriteType.all):
      '''Number of segments in a collection of neurites'''
      return sum(len(s.points) - 1
                 for s in iter_sections(neurites, neurite_filter=is_type(neurite_type)))
docs: Number of segments in a collection of neurites