def METHOD_NAME():
    given_stat_error = [1.1, 2.2, 3.3]
    given_sys_error = [10.1, 10.2, 10.3]
    def calc_stat(data, _model, staterror, syserror=None, weight=None):
        # Make sure values are being injected correctly
        np.testing.assert_array_equal(given_stat_error, staterror)
        np.testing.assert_array_equal(given_sys_error, syserror)
        return 3.235, np.ones_like(data)
    xdata = [1, 2, 3]
    ydata = xdata
    ui.load_arrays(1, xdata, ydata, None, given_sys_error, Data1D)
    ui.set_model(1, 'polynom1d.p')
    ui.load_user_stat('customstat', calc_stat, lambda x: given_stat_error)
    ui.set_stat(eval('customstat'))
    try:
        ui.fit(1)
    except StatErr:
        pytest.fail("Call should not be throwing any exception (bug #341)")
    # Test the result is what we made the user stat return
    assert 3.235 == ui.get_fit_results().statval