code: def test_exc_imperative():
      def imperative(exec_numpy=True):
          a = mx.nd.random.normal(0, 1, (2, 2))
          b = mx.nd.random.normal(0, -1, (2, 2))
          c = mx.nd.dot(a, b)
          if exec_numpy:
              c.asnumpy()
  
      imperative(exec_numpy=False)
      pytest.raises(MXNetError, imperative, exec_numpy=True)
  
file_path: mxnet/tests/python/unittest/test_exc_handling.py
imports: import os
  import mxnet
  import numpy
  from mxnet import gluon
  from mxnet.gluon import nn
  from mxnet.base import MXNetError
  from mxnet.test_utils import assert_exception, default_device, set_default_device, use_np
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_exc_imperative() without return types