code: def test_derive():
      def func(pars, x, data=None):
          model = pars["a"] * np.exp(-pars["b"] * x) + pars["c"]
          if data is None:
              return model
          return model - data
  
      def dfunc(pars, x, data=None):
          v = np.exp(-pars["b"] * x)
          return np.array([v, -pars["a"] * x * v, np.ones(len(x))])
  
      def f(var, x):
          return var[0] * np.exp(-var[1] * x) + var[2]
  
      params1 = Parameters()
      params1.add("a", value=10)
      params1.add("b", value=10)
      params1.add("c", value=10)
  
      params2 = Parameters()
      params2.add("a", value=10)
      params2.add("b", value=10)
      params2.add("c", value=10)
  
      a, b, c = 2.5, 1.3, 0.8
      x = np.linspace(0, 4, 50)
      y = f([a, b, c], x)
      data = y + 0.15 * np.random.normal(size=len(x))
  
      # fit without analytic derivative
      min1 = Minimizer(
          func, params1, fcn_args=(x,), fcn_kws={"data": data}
      )
      out1 = min1.leastsq()
  
      # fit with analytic derivative
      min2 = Minimizer(
          func, params2, fcn_args=(x,), fcn_kws={"data": data}
      )
      out2 = min2.leastsq(Dfun=dfunc, col_deriv=1)
  
      check_wo_stderr(out1.params["a"], out2.params["a"].value, 0.00005)
      check_wo_stderr(out1.params["b"], out2.params["b"].value, 0.00005)
      check_wo_stderr(out1.params["c"], out2.params["c"].value, 0.00005)
  
imports: import sys
  import unittest
  import numpy
  from numpy import pi
  from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
  import pytest
  from scipy.optimize import rosen_der
  from uncertainties import ufloat
  from lmfit import Minimizer, Parameters, minimize
  from lmfit.lineshapes import gaussian
  from lmfit.minimizer import HAS_EMCEE, SCALAR_METHODS, MinimizerResult, coerce_float64
  from lmfit.models import SineModel
label_desc: Use image node_id 6 for calling a global function with example usage: test_derive() and returns: unknown, np, unknown, model