code: def test_attrscope():
      attrscope_list = []
      with AttrScope(y="hi", z="hey") as attrscope:
          attrscope_list.append(attrscope)
  
          def f():
              with AttrScope(x="hello") as attrscope:
                  attrscope_list.append(attrscope)
  
          thread = threading.Thread(target=f)
          thread.start()
          thread.join()
          assert len(attrscope_list[0]._attr) == 2
          assert attrscope_list[1]._attr["x"] == "hello"
  
      e1 = threading.Event()
      e2 = threading.Event()
      status = [False]
  
      def g():
          with mx.AttrScope(x="hello"):
              e2.set()
              e1.wait()
              if "hello" in mx.attribute.current()._attr.values():
                  status[0] = True
  
      thread = threading.Thread(target=g)
      thread.start()
      e2.wait()
      with AttrScope(x="hi"):
          e1.set()
          thread.join()
      e1.clear()
      e2.clear()
      assert status[
          0
      ], "Spawned thread didn't set the correct attr key values"
  
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 2 for calling a global function with example usage: test_attrscope() without return types