code: def _sar_ear_inner(patch, cols, splits, divs, y_func):
      
  
      (spp_col, count_col, x_col, y_col), patch = \
          _get_cols(['spp_col', 'count_col', 'x_col', 'y_col'], cols, patch)
  
      # Loop through each split
      result_list = []
      for substring, subpatch in _yield_subpatches(patch, splits):
  
          # Get A0
          A0 = _patch_area(subpatch, x_col, y_col)
  
          # Loop through all divisions within this split
          all_spp = np.unique(subpatch.table[spp_col])
          subresultx = []
          subresulty = []
          subresultnspp = []
          subresultnindivids = []
          subdivlist = _split_divs(divs)
          for subdiv in subdivlist:
              spatial_table = _yield_spatial_table(subpatch, subdiv, spp_col,
                                          count_col, x_col, y_col)
              subresulty.append(y_func(spatial_table, all_spp))
              subresultx.append(A0 / eval(subdiv.replace(',', '*')))
              subresultnspp.append(np.mean(spatial_table['n_spp']))
              subresultnindivids.append(np.mean(spatial_table['n_individs']))
  
          # Append subset result
          subresult = pd.DataFrame({'div': subdivlist, 'x': subresultx,
                                    'y': subresulty, 'n_spp': subresultnspp,
                                    'n_individs': subresultnindivids})
          result_list.append((substring, subresult))
  
      return result_list
docs: y_func is function calculating the mean number of species or endemics,
      respectively, for the SAR or EAR