<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _make_ufunc(func, index=Ellipsis, **kwargs):
 # noqa: D202 """Make ufunc from function."""


    def _ufunc(ary):
        target = np.empty(ary.shape[:-2])
        for idx in np.ndindex(target.shape):
            target[idx] = np.asarray(func(ary[idx].ravel(), **kwargs))[index]
        return target

    return _ufunc