code: def test_get_device():
      context = chainerx.Context()
  
      device = context.get_device("native")
      assert device.name == "native:0"
      assert device.index == 0
  
      assert context.get_device("native:0") is device
      assert context.get_device("native", 0) is device
  
      with pytest.raises(chainerx.BackendError):
          context.get_device("something_that_does_not_exist:0")
  
file_path: chainer/tests/chainerx_tests/unit_tests/test_context.py
imports: import pytest
  import chainerx
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_device() without return types