code: def indice_collate_wrapper(func: Callable):
      """
      其功能是封装一层 collate_fn，将 dataset 取到的 tuple 数据分离开，将 idx 打包为 indices。
  
      :param func: 需要修饰的函数
      :return:
      """
      if (
          hasattr(func, "__name__")
          and func.__name__ == "_indice_collate_wrapper"
      ):  # 如果已经被包裹过了
          return func
  
      def _indice_collate_wrapper(
          tuple_data,
      ):  # 这里不能使用 functools.wraps ，否则会检测不到
          indice, ins_list = [], []
          for idx, ins in tuple_data:
              indice.append(idx)
              ins_list.append(ins)
          return indice, func(ins_list)
  
      _indice_collate_wrapper.__wrapped__ = func  # 记录对应的
  
      return _indice_collate_wrapper
  
file_path: fastNLP/fastNLP/core/dataloaders/utils.py
imports: import os
  from typing import Callable, Any, Union, Sequence
  from abc import ABC
  import inspect
  import ast
  from ..log import logger
  from ..utils.cache_results import get_func_calls, truncate_start_blanks
label_desc: Use image node_id 1 for calling a global function with example usage: indice_collate_wrapper(func) and returns: _indice_collate_wrapper, func, indice,  func