code: def dump_log_data(data, data_type, prec=4):
      """Covert data (a dictionary) into tagged json string for logging."""
      data[_TYPE] = data_type
      data = float_to_decimal(data, prec)
      data_json = simplejson.dumps(
          data, sort_keys=True, use_decimal=True
      )
      return "{:s}{:s}".format(_TAG, data_json)
  
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 4 for calling a global function with example usage: dump_log_data(data, data_type, prec) and returns: str