code: def test_fitreports_sort_pars(fitresult):
      """Test sorting of parameters in the fit report."""
      # not sorted
      report_split = fitresult.fit_report(sort_pars=False).split("\n")
      indx_vars = report_split.index("[[Variables]]")
      first_par = list(fitresult.params.keys())[0]
      assert first_par in report_split[indx_vars + 1]
  
      # sorted using default alphanumeric sort
      report_split = fitresult.fit_report(sort_pars=True).split("\n")
      indx_vars = report_split.index("[[Variables]]")
      assert "amplitude" in report_split[indx_vars + 1]
  
      # sorted using custom sorting algorithm: length of variable name
      def sort_length(s):
          return len(s)
  
      report_split = fitresult.fit_report(sort_pars=sort_length).split(
          "\n"
      )
      indx_vars = report_split.index("[[Variables]]")
      assert "fwhm" in report_split[indx_vars + 1]
  
imports: import numpy
  import pytest
  import lmfit
  from lmfit import Minimizer, Parameters, ci_report, conf_interval, fit_report, report_ci, report_fit
  from lmfit.lineshapes import gaussian
  from lmfit.models import GaussianModel
  from lmfit.printfuncs import alphanumeric_sort, correl_table, fitreport_html_table, getfloat_attr, gformat
label_desc: Use image node_id 11 for calling a global function with example usage: test_fitreports_sort_pars(fitresult) and returns: len