code: def _formatter(element, float_format="%.4f"):
      try:
          out = float_format % element
      except (ValueError, TypeError):
          out = str(element)
      return out.strip()
  
imports: from statsmodels.compat.pandas import FUTURE_STACK
  from statsmodels.compat.python import lzip
  import datetime
  from functools import reduce
  import re
  import textwrap
  import numpy
  import pandas
  from .table import SimpleTable
  from .tableformatting import fmt_latex, fmt_txt
label_desc: Use image node_id 8 for calling a global function with example usage: _formatter(element, float_format) and returns: out