code: def nvmlDeviceGetAPIRestriction(device, apiType):
      r
      c_permission = _nvmlEnableState_t()
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetAPIRestriction")
      ret = fn(device, _nvmlRestrictedAPI_t(apiType), byref(c_permission))
      _nvmlCheckReturn(ret)
      return int(c_permission.value)
docs: r"""
      /**
       * Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs.
       * If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions.
       *
       * For all fully supported products.
       *
       * @param device                               The identifier of the target device
       * @param apiType                              Target API type for this operation
       * @param isRestricted                         Reference in which to return the current restriction
       *                                             NVML_FEATURE_ENABLED indicates that the API is root-only
       *                                             NVML_FEATURE_DISABLED indicates that the API is accessible to all users
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a isRestricted has been set
       *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
       *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device or the device does not support
       *                                                 the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is
       *                                                 not supported by the device)
       *         - \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 nvmlRestrictedAPI_t
       */
      nvmlReturn_t DECLDIR nvmlDeviceGetAPIRestriction