code: def test_context_scope():
      context1 = chainerx.Context()
      context2 = chainerx.Context()
  
      chainerx.set_default_context(context1)
      with chainerx.context_scope(context2):
          assert chainerx.get_default_context() is context2
  
      scope = chainerx.context_scope(context2)
      assert chainerx.get_default_context() is context1
      with scope:
          assert chainerx.get_default_context() is context2
      assert chainerx.get_default_context() is context1
  
file_path: chainer/tests/chainerx_tests/unit_tests/test_context.py
imports: import pytest
  import chainerx
label_desc: Use image node_id 9 for calling a global function with example usage: test_context_scope() without return types