code: def is_number_or_numpy_number(dtype):
      """
      判断 dtype 是否是数字类型，或者 numpy 的数字类型。
      is_number_or_numpy_number(type(3))  # True
      is_number_or_numpy_number(type(3.1))  # True
      is_number_or_numpy_number(type('3'))  # False
      is_number_or_numpy_number(type(True))  # True
      is_number_or_numpy_number(type(np.zeros(3)[0]))  # True
      is_number_or_numpy_number(np.zeros(3, dtype=float).dtype)  # True
      is_number_or_numpy_number(np.zeros(3, dtype=int).dtype)  # True
      is_number_or_numpy_number(np.zeros(3, dtype=str).dtype)  # False
      is_number_or_numpy_number(np.array([1, [2]]).dtype)  # False
  
      :param dtype:
      :return:
      """
      if is_number(dtype):
          return True
      else:
          if isclass(dtype):
              return is_numpy_generic_class(dtype)
          elif (
              isinstance(dtype, np.dtype)
              and np_str_obj_array_pattern.search(dtype.str) is None
          ):
              return True
      return False
  
file_path: fastNLP/fastNLP/core/collators/padders/utils.py
imports: from typing import Sequence, List
  import re
  from inspect import isclass
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: is_number_or_numpy_number(dtype) and returns: False, True, is_numpy_generic_class, True