code: def test_saveload_usersyms():
      """Test save/load of ModelResult with non-trivial user symbols.
  
      This example uses a VoigtModel, where `wofz()` is used in a constraint
      expression.
  
      """
      x = np.linspace(0, 20, 501)
      y = gaussian(x, 1.1, 8.5, 2) + lorentzian(x, 1.7, 8.5, 1.5)
      np.random.seed(20)
      y = y + np.random.normal(size=len(x), scale=0.025)
  
      model = VoigtModel()
      pars = model.guess(y, x=x)
      result = model.fit(y, pars, x=x)
  
      savefile = "tmpvoigt_modelresult.sav"
      save_modelresult(result, savefile)
  
      assert_allclose(result.params["sigma"], 1.075487, rtol=1.0e-5)
      assert_allclose(result.params["center"], 8.489738, rtol=1.0e-5)
      assert_allclose(result.params["height"], 0.557778, rtol=1.0e-5)
  
      time.sleep(0.25)
      result2 = load_modelresult(savefile)
  
      assert result2.residual is not None
      assert_allclose(result2.params["sigma"], 1.075487, rtol=1.0e-5)
      assert_allclose(result2.params["center"], 8.489738, rtol=1.0e-5)
      assert_allclose(result2.params["height"], 0.557778, rtol=1.0e-5)
  
imports: import json
  import os
  import time
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  from lmfit import Parameters
  import lmfit.jsonutils
  from lmfit.lineshapes import gaussian, lorentzian
  from lmfit.model import Model, ModelResult, load_model, load_modelresult, save_model, save_modelresult
  from lmfit.models import ExponentialModel, ExpressionModel, GaussianModel, VoigtModel
label_desc: Use image node_id 14 for calling a global function with example usage: test_saveload_usersyms() without return types