code: def test_device_is_gpu_gpu_is_available(self, _):
      device = utils.check_device("gpu")
      self.assertEqual(DeviceType.GPU, device.type)
      self.assertEqual(device.idx, 0)
  
      device = utils.check_device("cuda")
      self.assertEqual(DeviceType.GPU, device.type)
      self.assertEqual(device.idx, 0)
  
      device = utils.check_device("cuda:1")
      self.assertEqual(DeviceType.GPU, device.type)
      self.assertEqual(device.idx, 1)
  
      device = utils.check_device("gpu:2")
      self.assertEqual(DeviceType.GPU, device.type)
      self.assertEqual(device.idx, 2)
  
file_path: nebuly/optimization/nebullvm/nebullvm/tools/tests/test_utils.py
imports: import unittest
  from unittest.mock import patch
  from nebullvm.core.models import DeviceType
  from nebullvm.tools import utils
label_desc: Use image node_id 7 for calling the TestCheckDevice obj's underlying member method code with example usage: obj.test_device_is_gpu_gpu_is_available(_) without return types