code: def test_np_array_scope():
      np_array_scope_list = []
      _NumpyArrayScope._current = _NumpyArrayScope(False)
      np_array_scope_list.append(_NumpyArrayScope._current)
  
      def f():
          _NumpyArrayScope._current = _NumpyArrayScope(True)
          np_array_scope_list.append(_NumpyArrayScope._current)
  
      thread = threading.Thread(target=f)
      thread.start()
      thread.join()
      assert len(np_array_scope_list) == 2
      assert not np_array_scope_list[0]._is_np_array
      assert np_array_scope_list[1]._is_np_array
  
      event = threading.Event()
      status = [False]
  
      def g():
          with mx.np_array(False):
              event.wait()
              if not mx.is_np_array():
                  status[0] = True
  
      thread = threading.Thread(target=g)
      thread.start()
      _NumpyArrayScope._current = _NumpyArrayScope(True)
      event.set()
      thread.join()
      event.clear()
      assert status[0], "Spawned thread didn't set status correctly"
  
file_path: mxnet/tests/python/unittest/test_thread_local.py
imports: import threading
  import numpy
  import mxnet
  from mxnet import device, attribute
  from mxnet.device import Device
  from mxnet.attribute import AttrScope
  from mxnet.test_utils import assert_almost_equal, set_default_device
  from mxnet.util import _NumpyArrayScope, set_np_shape
label_desc: Use image node_id 7 for calling a global function with example usage: test_np_array_scope() without return types