code: def test_getfloat_attr(params, par, attr, expected):
      """Test getfloat_attr function."""
      if par == "aa1":
          # add an attribute that is not None, float, or int
          # This will never occur for Parameter values, but this function is
          # also used on the MinimizerResult/ModelResult where it could happen.
          params["aa1"].test = 20 + 5j
  
      output = getfloat_attr(params[par], attr)
      assert output == expected
  
      if par == "a":
          assert (
              len(output) == 10
          )  # leading blank for pos values is stripped
      elif par == "b":
          assert len(output) == 11
      elif par == "c1":
          assert len(output) == 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 5 for calling a global function with example usage: test_getfloat_attr(params, par, attr, expected) without return types