code: def get_encoder_with_float_rounding(ndigits=2, key_ndigits=None):
      class FloatingDigitEncoder(ComplexEncoder):
          def encode(self, obj):
              obj = round_floats_for_json(obj, ndigits, key_ndigits)
              return super().encode(obj)
  
          def default(self, obj):
              obj = super().default(obj)
              obj = round_floats_for_json(obj, ndigits, key_ndigits)
              return obj
  
      return FloatingDigitEncoder
  
file_path: gluon-cv/gluoncv/torch/data/gluoncv_motion_dataset/utils/serialization_utils.py
imports: import json
  import pickle
  import pathlib
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: get_encoder_with_float_rounding(ndigits, key_ndigits) and returns: FloatingDigitEncoder, super, obj