def METHOD_NAME(index):
    c_index = ctypes.c_uint(index)
    device = c_nvmlDevice_t()
    fn = _get_nvml_function("nvmlDeviceGetHandleByIndex_v2")
    ret = fn(c_index, ctypes.byref(device))
    _check_return(ret)
    return device