@staticmethod
def _combine_result(result, msg, target):
    """Combine the execution result with the provided values.

        result -- x, (x, msg) or (x, msg, target)

        The values in result always has priority.
        """
    if isinstance(result, tuple):
        if msg:
            if result[1]:
                msg.update(result[1])
            result = (result[0], msg) + result[2:]
        if target is not None and len(result) == 2:
            result += target,
        return result
    elif not msg and target is None:
        return result
    elif target is None:
        return result, msg
    else:
        return result, msg, target
