code: def test_using_device_with_name(device_instance1, device_instance2):
      if device_instance1 == device_instance2:
          return
  
      device1 = device_instance1
      device2 = device_instance2
  
      chainerx.set_default_device(device1)
      with chainerx.using_device(device2.name) as scope:
          assert chainerx.get_default_device() == device2
          assert scope.device is device2
  
      with chainerx.using_device(
          device2.backend.name, device2.index
      ) as scope:
          assert chainerx.get_default_device() == device2
          assert scope.device is device2
  
file_path: chainer/tests/chainerx_tests/unit_tests/test_device.py
imports: import copy
  import pickle
  import pytest
  import chainerx
label_desc: Use image node_id 12 for calling a global function with example usage: test_using_device_with_name(device_instance1, device_instance2) without return types