code: def nvmlDeviceGetPowerState(handle):
      r
      c_pstate = _nvmlPstates_t()
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetPowerState")
      ret = fn(handle, byref(c_pstate))
      _nvmlCheckReturn(ret)
      return bytes_to_str(c_pstate.value)
docs: r"""
      /**
       * Deprecated: Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization.
       *
       * Retrieve the current performance state for the device.
       *
       * For Fermi &tm; or newer fully supported devices.
       *
       * See \ref nvmlPstates_t for details on allowed performance states.
       *
       * @param device                               The identifier of the target device
       * @param pState                               Reference in which to return the performance state reading
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a pState 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 or \a pState is NULL
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not 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 nvmlDeviceGetPowerState