code: def _is_allennlp_metric(metric: Any) -> bool:
      """
      检查输入的对象是否为allennlp对象
  
      :param metric:
      :return:
      """
      if _IS_ALLENNLP_AVAILABLE:
          return isinstance(metric, allennlp_Metric)
      else:
          return False
  
file_path: fastNLP/fastNLP/core/metrics/utils.py
imports: from typing import Any
  from functools import wraps
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE, _NEED_IMPORT_TORCH
  from fastNLP.envs.utils import _module_available
label_desc: Use image node_id 2 for calling a global function with example usage: _is_allennlp_metric(metric) and returns: isinstance, False