code: def jittor_collate_wraps(func, auto_collator: Callable):
      """
      对 ``jittor`` 的 ``collate_fn`` 进行 wrap 封装,。如果数据集为 :class:`Mapping` 类型，那么采用 ``auto_collator`` ，
      否则还是采用 ``jittor`` 的 ``collate_batch``。
  
      :param func:
      :param auto_collator:
      :return:
      """
  
      @wraps(func)
      def wrapper(batch):
          if isinstance(batch[0], Instance):
              if auto_collator is not None:
                  result = auto_collator(batch)
              else:
                  raise ValueError(
                      f"auto_collator is None, but batch exist fastnlp instance!"
                  )
          elif isinstance(batch[0], Mapping):
              if auto_collator is not None:
                  result = auto_collator(batch)
              else:
                  result = func(batch)
          else:
              result = func(batch)
          return result
  
      return wrapper
  
imports: from collections.abc import Mapping, Callable
  from functools import wraps
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR
  from fastNLP.core.dataset import Instance
label_desc: Use image node_id 3 for calling a global function with example usage: jittor_collate_wraps(func, auto_collator) and returns: wrapper, result