docs: def iter_neurites(obj, mapfun=None, filt=None, neurite_order=NeuriteIter.FileOrder):
      '''Iterator to a neurite, neuron or neuron population
  
      Applies optional neurite filter and mapping functions.
  
      Parameters:
          obj: a neurite, neuron or neuron population.
          mapfun: optional neurite mapping function.
          filt: optional neurite filter function.
          neurite_order (NeuriteIter): order upon which neurites should be iterated
              - NeuriteIter.FileOrder: order of appearance in the file
              - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
  
      Examples:
  
          Get the number of points in each neurite in a neuron population
  
          >>> from neurom.core import iter_neurites
          >>> n_points = [n for n in iter_neurites(pop, lambda x : len(x.points))]
  
          Get the number of points in each axon in a neuron population
  
          >>> import neurom as nm
          >>> from neurom.core import iter_neurites
          >>> filter = lambda n : n.type == nm.AXON
          >>> mapping = lambda n : len(n.points)
          >>> n_points = [n for n in iter_neurites(pop, mapping, filter)]
  
      '''
      neurites = ((obj,) if isinstance(obj, Neurite) else
                  obj.neurites if hasattr(obj, 'neurites') else obj)
      if neurite_order == NeuriteIter.NRN:
          last_position = max(NRN_ORDER.values()) + 1
          neurites = sorted(neurites, key=lambda neurite: NRN_ORDER.get(neurite.type, last_position))
  
      neurite_iter = iter(neurites) if filt is None else filter(filt, neurites)
      return neurite_iter if mapfun is None else map(mapfun, neurite_iter)