code: def nvmlDeviceGetAccountingPids(handle):
      r
      count = c_uint(nvmlDeviceGetAccountingBufferSize(handle))
      pids = (c_uint * count.value)()
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetAccountingPids")
      ret = fn(handle, byref(count), pids)
      _nvmlCheckReturn(ret)
      return list(map(int, pids[0:count.value]))
docs: r"""
      /**
       * Queries list of processes that can be queried for accounting stats. The list of processes returned
       * can be in running or terminated state.
       *
       * For Kepler &tm; or newer fully supported devices.
       *
       * To just query the number of processes ready to be queried, call this function with *count = 0 and
       * pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
       *
       * For more details see \ref nvmlDeviceGetAccountingStats.
       *
       * @note In case of PID collision some processes might not be accessible before the circular buffer is full.
       *
       * @param device                               The identifier of the target device
       * @param count                                Reference in which to provide the \a pids array size, and
       *                                               to return the number of elements ready to be queried
       * @param pids                                 Reference in which to return list of process ids
       *
       * @return
       *         - \ref NVML_SUCCESS                 if pids were successfully retrieved
       *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
       *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a count is NULL
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
       *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to
       *                                                 expected value)
       *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
       *
       * @see nvmlDeviceGetAccountingBufferSize
       */
      nvmlReturn_t DECLDIR nvmlDeviceGetAccountingPids