code: def test_algebraic_constraints_function(minimizer):
      """Test constraints with a user-defined function added to symbol table."""
  
      def width_func(wpar):
          return 2.5 * wpar
  
      minimizer.params._asteval.symtable["wfun"] = width_func
      minimizer.params.add(name="wid_l", expr="wfun(wid_g)")
      result = minimizer.minimize(method="leastsq")
  
      pfit = result.params
      assert pfit["cen_l"].value == 1.5 + pfit["cen_g"].value
      assert (
          pfit["amp_l"].value
          == pfit["amp_tot"].value - pfit["amp_g"].value
      )
      assert pfit["wid_l"].value == 2.5 * pfit["wid_g"].value
  
file_path: lmfit-py/tests/test_algebraic_constraint.py
imports: import numpy
  import pytest
  from lmfit import Minimizer, Model, Parameters
  from lmfit.lineshapes import gaussian, lorentzian
label_desc: Use image node_id 3 for calling a global function with example usage: test_algebraic_constraints_function(minimizer) and returns: unknown