code: def callable(cls, nans=False, reverse=False, scalar=False):
          
          _valgetter = cls._valgetter_scalar if scalar else cls._valgetter
          valgetter = nb.njit(_valgetter)
          outersetter = nb.njit(cls._outersetter)
  
          _cls_inner = nb.njit(cls._inner)
          if nans:
              def _inner(ri, val, ret, counter, mean):
                  if not np.isnan(val):
                      _cls_inner(ri, val, ret, counter, mean)
              inner = nb.njit(_inner)
          else:
              inner = _cls_inner
  
          def _loop(group_idx, a, ret, counter, mean, outer, fill_value, ddof):
              # fill_value and ddof need to be present for being exchangeable with loop_2pass
              size = len(ret)
              rng = range(len(group_idx) - 1, -1 , -1) if reverse else range(len(group_idx))
              for i in rng:
                  ri = group_idx[i]
                  if ri < 0:
                      raise ValueError("negative indices not supported")
                  if ri >= size:
                      raise ValueError("one or more indices in group_idx are too large")
                  val = valgetter(a, i)
                  inner(ri, val, ret, counter, mean)
                  outersetter(outer, i, ret[ri])
          return nb.njit(_loop, nogil=True)
docs: Compile a jitted function doing the hard part of the job