code: def set_digits(obj, digits):
      if isinstance(obj, Sequence):
          obj = type(obj)([set_digits(item, digits) for item in obj])
      elif isinstance(obj, Mapping):
          obj = type(obj)(
              {key: set_digits(val, digits) for key, val in obj.items()}
          )
      elif isinstance(obj, float):
          obj = round(obj, digits)
      return obj
  
file_path: PaddleSeg/contrib/PanopticSeg/paddlepanseg/utils/misc.py
imports: import copy
  import importlib
  from collections.abc import Mapping, Sequence
  from contextlib import contextmanager
  from tabulate import tabulate
  from paddleseg.utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: set_digits(obj, digits) and returns: obj