def set_result(self, result, validate=False):
        """
        Set result
        Not all fields have to be filled

        This method should be rarely used because it can
        cause invalid results

        Use validate=True and catch ValidationError to ensure
        given result is correct

        Result = <{
            'status'   : 'OK' | 'WARN' | 'ERROR',
            'messages' : Messages | NULL,
            'componentResults' : (STRING : {
                'status'  : 'OK' | 'WARN' | 'ERROR',
                'messages': Messages
            })* | NULL,
            'action'   : Result | NULL
        }>

        Messages = {
            'info' : [STRING],
            'error': [STRING],
            'warn' : [STRING]
        }
        """
        fields = [ 'status', 'messages', 'componentResults', 'action' ]

        for field in fields:
            try:
                self.result[field] = result[field]
            except __HOLE__:
                # just skip missing fields
                pass

        if validate == True:
            self.validate()
dataset/ETHPy150Open gooddata/smoker/smoker/server/plugins/__init__.py/Result.set_result