code: def test_modelresult_summary():
      """Test summary() method of ModelResult."""
      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)
  
      summary = result.summary()
  
      assert isinstance(summary, dict)
  
      for attr in (
          "ndata",
          "nvarys",
          "nfree",
          "chisqr",
          "redchi",
          "aic",
          "bic",
          "rsquared",
          "nfev",
          "max_nfev",
          "aborted",
          "errorbars",
          "success",
          "message",
          "lmdif_message",
          "ier",
          "nan_policy",
          "scale_covar",
          "calc_covar",
          "ci_out",
          "col_deriv",
          "flatchain",
          "call_kws",
          "var_names",
          "user_options",
          "kws",
          "init_values",
          "best_values",
      ):
          val = summary.get(attr, "__INVALID__")
          assert val != "__INVALID__"
  
      assert len(json.dumps(summary)) > 100
  
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 15 for calling a global function with example usage: test_modelresult_summary() without return types