def _make_xy_sfunc(func, ndim_output=False):
 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

def _make_xy_sfunc ( func , ndim_output = False ) : 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
aux function .