code: def with_array_function_protocol(func):
      """A decorator for functions that expect array function protocol.
      The decorated function only runs when NumPy version >= 1.17."""
      from distutils.version import LooseVersion
  
      cur_np_ver = LooseVersion(_np.__version__)
      np_1_17_ver = LooseVersion("1.17")
  
      @functools.wraps(func)
      def _run_with_array_func_proto(*args, **kwargs):
          if cur_np_ver >= np_1_17_ver:
              try:
                  func(*args, **kwargs)
              except Exception as e:
                  raise RuntimeError(
                      "Running function {} with NumPy array function protocol failed"
                      " with exception {}".format(func.__name__, str(e))
                  )
  
      return _run_with_array_func_proto
  
file_path: mxnet/python/mxnet/numpy_dispatch_protocol.py
imports: import functools
  import numpy
  from .None import numpy
  from .numpy.multiarray import _NUMPY_ARRAY_FUNCTION_DICT, _NUMPY_ARRAY_UFUNC_DICT
label_desc: Use image node_id 3 for calling a global function with example usage: with_array_function_protocol(func) and returns: _run_with_array_func_proto