human
Complete the below
def _make_xy_sfunc(func, ndim_output=False):

    ''''Aux function.'
    '''
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    if ndim_output:
        def sfunc(x, y):
            return np.array([func(a, y.ravel()) for a in x])[:, 0]
    else:
        def sfunc(x, y):
            return np.array([func(a, y.ravel()) for a in x])
    sfunc.__name__ = '.'.join(['score_func', func.__module__, func.__name__])
    sfunc.__doc__ = func.__doc__
    return sfunc