docs: def extract_stats(neurons, config):
      '''Extract stats from neurons'''
  
      stats = defaultdict(dict)
      for ns, modes in config['neurite'].items():
          for n in config['neurite_type']:
              n = _NEURITE_MAP[n]
              for mode in modes:
                  stat_name = _stat_name(ns, mode)
                  stat = eval_stats(nm.get(ns, neurons, neurite_type=n), mode)
  
                  if stat is None or not stat.shape:
                      stats[n.name][stat_name] = stat
                  else:
                      assert stat.shape in ((3, ), ), \
                          'Statistic must create a 1x3 result'
  
                      for i, suffix in enumerate('XYZ'):
                          compound_stat_name = stat_name + '_' + suffix
                          stats[n.name][compound_stat_name] = stat[i]
  
      for ns, modes in config['neuron'].items():
          for mode in modes:
              stat_name = _stat_name(ns, mode)
              stats[stat_name] = eval_stats(nm.get(ns, neurons), mode)
  
      return stats