<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _call_fitter(fitter, psf, x, y, data, weights):
 """ Not all fitters have to support a weight array. This function includes the weight in the fitter call only if really needed. """


    if np.all(weights == 1.):
        return fitter(psf, x, y, data)
    else:
        return fitter(psf, x, y, data, weights=weights)