code: def test_saveload_modelresult_roundtrip(method):
      """Test for modelresult.loads()/dumps() and repeating that."""
  
      def mfunc(x, a, b):
          return a * (x - b)
  
      model = Model(mfunc)
      params = model.make_params(a=0.1, b=3.0)
      params["a"].set(min=0.01, max=1, brute_step=0.01)
      params["b"].set(min=0.01, max=3.1, brute_step=0.01)
  
      np.random.seed(2020)
      xx = np.linspace(-5, 5, 201)
      yy = 0.5 * (xx - 0.22) + np.random.normal(
          scale=0.01, size=xx.size
      )
  
      result1 = model.fit(yy, params=params, x=xx, method=method)
  
      result2 = ModelResult(model, Parameters())
      result2.loads(result1.dumps(), funcdefs={"mfunc": mfunc})
  
      result3 = ModelResult(model, Parameters())
      result3.loads(result2.dumps(), funcdefs={"mfunc": mfunc})
  
      assert result3 is not None
      assert_allclose(result2.params["a"], 0.5, rtol=1.0e-2)
      assert_allclose(result2.params["b"], 0.22, rtol=1.0e-2)
      assert_allclose(result3.params["a"], 0.50, rtol=1.0e-2)
      assert_allclose(result3.params["b"], 0.22, rtol=1.0e-2)
  
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 10 for calling a global function with example usage: test_saveload_modelresult_roundtrip(method) and returns: unknown