code: def float_to_decimal(data, prec=4):
      """Convert floats to decimals which allows for fixed width json."""
      if prec and isinstance(data, dict):
          return {k: float_to_decimal(v, prec) for k, v in data.items()}
      if prec and isinstance(data, float):
          return decimal.Decimal(
              ("{:." + str(prec) + "f}").format(data)
          )
      else:
          return data
  
file_path: pycls/pycls/core/logging.py
imports: import builtins
  import decimal
  import logging
  import os
  import sys
  import pycls.core.distributed
  import simplejson
  from pycls.core.config import cfg
  from pycls.core.io import pathmgr
label_desc: Use image node_id 5 for calling a global function with example usage: float_to_decimal(data, prec) and returns: unknown, decimal, data