code: def test_exc_post_fail():
      def post_fail(waitall=False):
          caught = False
          try:
              a, b = mx.nd.random_normal(0, -1, (2, 2)).copyto(
                  default_device()
              )
              if waitall:
                  mx.nd.waitall()
              else:
                  a.asnumpy()
          except MXNetError:
              caught = True
          assert caught, "No exception thrown"
          b.asnumpy()
  
      post_fail(waitall=False)
      post_fail(waitall=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 4 for calling a global function with example usage: test_exc_post_fail() without return types