docs: def nvmlDeviceGetHandleByIndex(index):
      r"""
      /**
       * Acquire the handle for a particular device, based on its index.
       *
       * For all products.
       *
       * Valid indices are derived from the \a accessibleDevices count returned by
       *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices
       *   are 0 and 1, corresponding to GPU 0 and GPU 1.
       *
       * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
       *   is recommended that devices be looked up by their PCI ids or UUID. See
       *   \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId().
       *
       * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
       *
       * Starting from NVML 5, this API causes NVML to initialize the target GPU
       * NVML may initialize additional GPUs if:
       *  - The target GPU is an SLI slave
       *
       * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
       *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
       *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
       *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
       *       library.
       *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
       *
       *       This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index.
       *       If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't
       *       need to worry about that.
       *
       * @param index                                The index of the target GPU, >= 0 and < \a accessibleDevices
       * @param device                               Reference in which to return the device handle
       *
       * @return
       *         - \ref NVML_SUCCESS                  if \a device has been set
       *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
       *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a index is invalid or \a device is NULL
       *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
       *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
       *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
       *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
       *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
       *
       * @see nvmlDeviceGetIndex
       * @see nvmlDeviceGetCount
       */
      nvmlReturn_t DECLDIR nvmlDeviceGetHandleByIndex
      """
      """
  /**
   * Acquire the handle for a particular device, based on its index.
   *
   * For all products.
   *
   * Valid indices are derived from the \a accessibleDevices count returned by
   *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices
   *   are 0 and 1, corresponding to GPU 0 and GPU 1.
   *
   * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
   *   is recommended that devices be looked up by their PCI ids or UUID. See
   *   \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId().
   *
   * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
   *
   * Starting from NVML 5, this API causes NVML to initialize the target GPU
   * NVML may initialize additional GPUs if:
   *  - The target GPU is an SLI slave
   *
   * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
   *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
   *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
   *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
   *       library.
   *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
   *
   *       This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index.
   *       If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't
   *       need to worry about that.
   *
   * @param index                                The index of the target GPU, >= 0 and < \a accessibleDevices
   * @param device                               Reference in which to return the device handle
   *
   * @return
   *         - \ref NVML_SUCCESS                  if \a device has been set
   *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
   *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a index is invalid or \a device is NULL
   *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
   *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
   *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
   *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
   *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
   *
   * @see nvmlDeviceGetIndex
   * @see nvmlDeviceGetCount
   */
      """
      c_index = c_uint(index)
      device = c_nvmlDevice_t()
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetHandleByIndex_v2")
      ret = fn(c_index, byref(device))
      _nvmlCheckReturn(ret)
      return bytes_to_str(device)