code: def as_format(item, format_str=".2f"):
      """
      Map a format string over a pandas object.
      """
      if isinstance(item, pd.Series):
          return item.map(lambda x: format(x, format_str))
      elif isinstance(item, pd.DataFrame):
          return item.applymap(lambda x: format(x, format_str))
  
file_path: ffn/ffn/utils.py
imports: import re
  import decorator
  import numpy
  import pandas
label_desc: Use image node_id 12 for calling a global function with example usage: as_format(item, format_str) and returns: item, item