docs: def iter_segments(obj, neurite_filter=None, neurite_order=NeuriteIter.FileOrder):
      '''Return an iterator to the segments in a collection of neurites
  
      Parameters:
          obj: neuron, population, neurite, section, or iterable containing neurite objects
          neurite_filter: optional top level filter on properties of neurite neurite objects
          neurite_order: order upon which neurite should be iterated. Values:
              - NeuriteIter.FileOrder: order of appearance in the file
              - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
  
      Note:
          This is a convenience function provided for generic access to
          neuron segments. It may have a performance overhead WRT custom-made
          segment analysis functions that leverage numpy and section-wise iteration.
      '''
      sections = iter((obj,) if isinstance(obj, Section) else
                      iter_sections(obj,
                                    neurite_filter=neurite_filter,
                                    neurite_order=neurite_order))
  
      return chain.from_iterable(zip(sec.points[:-1], sec.points[1:])
                                 for sec in sections)