code: def device(self, idx):
          
  
          class GpuDevice(Structure):
              pass
  
          c_nvmlDevice_t = POINTER(GpuDevice)
  
          c_index = c_uint(idx)
          device = c_nvmlDevice_t()
          _check_return(_NVML.get_function(
              "nvmlDeviceGetHandleByIndex_v2")(c_index, byref(device)))
          return NvidiaDevice(device)
docs: Get a specific GPU device
  
          Args:
              idx: index of device
  
          Returns:
              NvidiaDevice: single GPU device