code: def test_confidence_exceptions(data, pars):
      """Make sure the proper exceptions are raised when needed."""
      minimizer = lmfit.Minimizer(
          residual, pars, calc_covar=False, fcn_args=data
      )
      out = minimizer.minimize(method="nelder")
      out_lsq = minimizer.minimize(params=out.params, method="leastsq")
  
      # no uncertainty estimated
      msg = "Cannot determine Confidence Intervals without sensible uncertainty"
      with pytest.raises(lmfit.MinimizerException, match=msg):
          lmfit.conf_interval(minimizer, out)
  
      # uncertainty is NaN
      out_lsq.params["a"].stderr = np.nan
      with pytest.raises(lmfit.MinimizerException, match=msg):
          lmfit.conf_interval(minimizer, out_lsq)
  
      # only one varying parameter
      out_lsq.params["a"].vary = False
      msg = r"Cannot determine Confidence Intervals with < 2 variables"
      with pytest.raises(lmfit.MinimizerException, match=msg):
          lmfit.conf_interval(minimizer, out_lsq)
  
imports: import copy
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  from scipy.stats import f
  import lmfit
label_desc: Use image node_id 10 for calling a global function with example usage: test_confidence_exceptions(data, pars) without return types