docs: def nvmlDeviceGetRetiredPages(device, sourceFilter):
      r"""
      /**
       * Returns the list of retired pages by source, including pages that are pending retirement
       * The address information provided from this API is the hardware address of the page that was retired.  Note
       * that this does not match the virtual address used in CUDA, but will match the address information in XID 63
       *
       * For Kepler &tm; or newer fully supported devices.
       *
       * @param device                            The identifier of the target device
       * @param cause                             Filter page addresses by cause of retirement
       * @param pageCount                         Reference in which to provide the \a addresses buffer size, and
       *                                          to return the number of retired pages that match \a cause
       *                                          Set to 0 to query the size without allocating an \a addresses buffer
       * @param addresses                         Buffer to write the page addresses into
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a pageCount was populated and \a addresses was filled
       *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
       *                                             matching page addresses.  \a pageCount is set to the needed size.
       *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
       *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or
       *                                             \a addresses is NULL
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
       *         - \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
       */
      nvmlReturn_t DECLDIR nvmlDeviceGetRetiredPages
      """
      c_source = _nvmlPageRetirementCause_t(sourceFilter)
      c_count = c_uint(0)
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetRetiredPages")
  
      # First call will get the size
      ret = fn(device, c_source, byref(c_count), None)
  
      # this should only fail with insufficient size
      if ((ret != NVML_SUCCESS) and
          (ret != NVML_ERROR_INSUFFICIENT_SIZE)):
          raise NVMLError(ret)
  
      # call again with a buffer
      # oversize the array for the rare cases where additional pages
      # are retired between NVML calls
      c_count.value = c_count.value * 2 + 5
      page_array = c_ulonglong * c_count.value
      c_pages = page_array()
      ret = fn(device, c_source, byref(c_count), c_pages)
      _nvmlCheckReturn(ret)
      return list(map(int, c_pages[0:c_count.value]))