code: def ci_report(ci, with_offset=True, ndigits=5):
      """Return text of a report for confidence intervals.
  
      Parameters
      ----------
      ci : dict
          The result of :func:`~lmfit.confidence.conf_interval`: a dictionary
          containing a list of ``(sigma, vals)``-tuples for each parameter.
      with_offset : bool, optional
          Whether to subtract best value from all other values (default is
          True).
      ndigits : int, optional
          Number of significant digits to show (default is 5).
  
      Returns
      -------
      str
          Text of formatted report on confidence intervals.
  
      """
      maxlen = max(len(i) for i in ci)
      buff = []
      add = buff.append
  
      def convp(x):
          """Convert probabilities into header for CI report."""
          if abs(x[0]) < 1.0e-2:
              return "_BEST_"
          return f"{x[0] * 100:.2f}%"
  
      title_shown = False
      fmt_best = fmt_diff = "{0:.%if}" % ndigits
      if with_offset:
          fmt_diff = "{0:+.%if}" % ndigits
      for name, row in ci.items():
          if not title_shown:
              add(
                  "".join(
                      ["".rjust(maxlen + 1)]
                      + [i.rjust(ndigits + 5) for i in map(convp, row)]
                  )
              )
              title_shown = True
          thisrow = [f" {name.ljust(maxlen)}:"]
          offset = 0.0
          if with_offset:
              for cval, val in row:
                  if abs(cval) < 1.0e-2:
                      offset = val
          for cval, val in row:
              if cval < 1.0e-2:
                  sval = fmt_best.format(val)
              else:
                  sval = fmt_diff.format(val - offset)
              thisrow.append(sval.rjust(ndigits + 5))
          add("".join(thisrow))
  
      return "\n".join(buff)
  
file_path: lmfit-py/lmfit/printfuncs.py
imports: from math import log10
  import re
  import numpy
label_desc: Use image node_id 12 for calling a global function with example usage: ci_report(ci, with_offset, ndigits) and returns: str, unknown, str, str