code: def _format_bf(bf, precision=3, trim="0"):
      """Format BF10 to floating point or scientific notation."""
      if type(bf) == str:
          return bf
      if bf >= 1e4 or bf <= 1e-4:
          out = np.format_float_scientific(
              bf, precision=precision, trim=trim
          )
      else:
          out = np.format_float_positional(
              bf, precision=precision, trim=trim
          )
      return out
  
imports: import warnings
  import numpy
  from scipy.integrate import quad
  from math import pi, exp, log, lgamma
label_desc: Use image node_id 1 for calling a global function with example usage: _format_bf(bf, precision, trim) and returns: out, bf