code: def test_saveload_modelresult_attributes():
      """Test for restoring all attributes of the ModelResult."""
      model, params = create_model_params(x, y)
      result = model.fit(y, params, x=x)
      save_modelresult(result, SAVE_MODELRESULT)
  
      time.sleep(0.25)
      file_exists = wait_for_file(SAVE_MODELRESULT, timeout=10)
      assert file_exists
      time.sleep(0.25)
  
      loaded = load_modelresult(SAVE_MODELRESULT)
  
      assert len(result.data) == len(loaded.data)
      assert_allclose(result.data, loaded.data)
  
      for pname in result.params.keys():
          assert_allclose(
              result.init_params[pname].value,
              loaded.init_params[pname].value,
          )
  
      clear_savefile(SAVE_MODELRESULT)
  
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 8 for calling a global function with example usage: test_saveload_modelresult_attributes() without return types