def updateCompletionAndStatus(self, commandId, completion, status, message, stats=None):
        try:
            commandWatcher = self.commandWatchers[commandId]
        except __HOLE__:
            LOGGER.warning("attempt to update completion and status of unregistered  command %d", commandId)
        else:
            commandWatcher.modified = True
            if commandWatcher.command.status == COMMAND.CMD_CANCELED:
                return
            if completion is not None:
                commandWatcher.command.completion = completion
            if message is not None:
                commandWatcher.command.message = message
            if status is not None:
                commandWatcher.command.status = status
                if COMMAND.isFinalStatus(status):
                    commandWatcher.finished = True

            # Add a stats dict that will allow runner to send back useful data on the server.
            # Data can be large, need to avoid to send it every command update.
            # The stats value is None when no update need to be updated on the server.
            commandWatcher.command.stats = stats
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py/Worker.updateCompletionAndStatus