code: def Compare_NIST_Results(DataSet, myfit, params, NISTdata):
      buff = [
          " ======================================",
          f" {DataSet}: ",
          " | Parameter Name |  Value Found   |  Certified Value | # Matching Digits |",
      ]
      buff.append(ABAR)
  
      val_dig_min = 200
      err_dig_min = 200
      fmt = " | %s | % -.7e | % -.7e   | %2i                |"
      for i in range(NISTdata["nparams"]):
          parname = f"b{i+1}"
          par = params[parname]
          thisval = par.value
          certval = NISTdata["cert_values"][i]
          vdig = ndig(thisval, certval)
          pname = (parname + " value " + " " * 14)[:14]
          buff.append(fmt % (pname, thisval, certval, vdig))
          val_dig_min = min(val_dig_min, vdig)
  
          thiserr = par.stderr
          certerr = NISTdata["cert_stderr"][i]
          if thiserr is not None and myfit.errorbars:
              edig = ndig(thiserr, certerr)
              ename = (parname + " stderr" + " " * 14)[:14]
              buff.append(fmt % (ename, thiserr, certerr, edig))
              err_dig_min = min(err_dig_min, edig)
  
      buff.append(ABAR)
      sumsq = NISTdata["sum_squares"]
      try:
          chi2 = myfit.chisqr
          buff.append(
              " | Sum of Squares | %.7e  | %.7e    |  %2i               |"
              % (chi2, sumsq, ndig(chi2, sumsq))
          )
      except Exception:
          pass
      buff.append(ABAR)
      if not myfit.errorbars:
          buff.append(
              " |          * * * * COULD NOT ESTIMATE UNCERTAINTIES * * * *              |"
          )
          err_dig_min = 0
      if err_dig_min < 199:
          buff.append(
              f" Worst agreement: {val_dig_min} digits for value, "
              f"{err_dig_min} digits for error "
          )
      else:
          buff.append(f" Worst agreement: {val_dig_min} digits")
      return val_dig_min, "\n".join(buff)
  
imports: import math
  from optparse import OptionParser
  from numpy.testing import assert_allclose
  from lmfit import Parameters, minimize
  from .NISTModels import Models, ReadNistData
label_desc: Use image node_id 2 for calling a global function with example usage: Compare_NIST_Results(DataSet, myfit, params, NISTdata) and returns: val_dig_min,  str