human
I wrote the below code

    from scipy.optimize import fmin_cobyla
    if (isinstance(disp, string_types) and (disp == 'auto')):
        disp = (True if (logger.level <= 20) else False)
    radii = ((np.max(points, axis=1) - np.min(points, axis=1)) / 2.0)
    radius_init = radii.mean()
    center_init = np.median(points, axis=0)
    x0 = np.concatenate([center_init, [radius_init]])
    def cost_fun(center_rad):
        d = (np.linalg.norm((points - center_rad[:3]), axis=1) - center_rad[3])
        d *= d
        return d.sum()
    def constraint(center_rad):
        return center_rad[3]
    x_opt = fmin_cobyla(cost_fun, x0, constraint, rhobeg=radius_init, rhoend=(radius_init * 1e-06), disp=disp)
    origin = x_opt[:3]
    radius = x_opt[3]
    return (radius, origin)

What's a good function header?
assistant
#Here's a good function header.

def _fit_sphere(points, disp='auto'):