code: def _get_backend() -> str:
      """
      当 Collator 的 backend 为 None 的时候如何，通过这个函数自动判定其 backend 。判断方法主要为以下两个：
      （1）尝试通过向上寻找当前 collator 的 callee 对象，根据 callee 对象寻找。然后使用 '/site-packages/{backend}' 来寻找是否是
          某个 backend 的 dataloader 。
      （2）如果方式（1）没找，则通过分析 sys.modules 中的内容进行寻找。
  
      如果都没有找到则返回 numpy 。
      :return:
      """
  
      def _check_module(module):
          """
          检查该 module 是否含有 某个 backend 的特征
  
          :param module: module 对象
          :return:
          """
          catch_backend = []
          try:
              file = module.__file__
              for backend in SUPPORT_BACKENDS:
                  if f"{os.sep}site-packages{os.sep}{backend}" in file:
                      catch_backend = [backend, file]
          except:
              pass
          return catch_backend
  
      currentframe = inspect.currentframe()
      # 方式（1）
      catch_backend = []
      for i in range(100):
          currentframe = currentframe.f_back
          if currentframe is not None:
              module = inspect.getmodule(currentframe)
              if module is not None:
                  catch_backend = _check_module(module)
                  if len(catch_backend):  # 主要捕获到一个就结束吧
                      break
          else:
              break
      if len(catch_backend):
          logger.debug(
              f"Find a file named:{catch_backend[1]} from stack contains backend:{catch_backend[0]}."
          )
          return AUTO_BACKEND_MAPPING.get(
              catch_backend[0], catch_backend[0]
          )
  
      # 方式 (2)
      for backend in SUPPORT_BACKENDS:
          if backend in sys.modules:
              logger.debug(f"sys.modules contains backend:{backend}.")
              return backend
      for key, module in sys.modules.items():
          catch_backend = _check_module(module)
          if catch_backend:
              break
      if len(catch_backend):
          logger.debug(
              f"Find a module file named:{catch_backend[1]} from sys.modules contains backend:{catch_backend[0]}."
          )
          return catch_backend[0]
  
      return "numpy"
  
file_path: fastNLP/fastNLP/core/collators/collator.py
imports: from typing import List, Union, Dict, Callable, Sequence, Mapping
  import os
  import sys
  import inspect
  import re
  from fastNLP.core.log import logger
  from .padders.get_padder import get_padder
  from ...envs import SUPPORT_BACKENDS
  from .padders import Padder
  from .packer_unpacker import SequencePackerUnpacker, SinglePackerUnpacker, MappingPackerUnpacker, NestedMappingPackerUnpacker
label_desc: Use image node_id 1 for calling a global function with example usage: _get_backend() and returns: str, catch_backend, AUTO_BACKEND_MAPPING, catch_backend, backend