<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _result(self, command_response, log=None):
 """Create a CommandResult for a request response. :param command_response: command request response :type command_response: dict :param log: list of log messages (optional) :type log: list :return: a CommandResult containing any given log messages :rtype: :py:class:`vici.session.CommandResult` """

        if command_response["success"] == "yes":
            return CommandResult(True, None, log)
        else:
            return CommandResult(False, command_response["errmsg"], log)