@classmethod
    def validate(cls, data):
        try:
            su.schema_validate(data, cls.SCHEMA)
        except su.ValidationError as e:
            cls_name = reflection.get_class_name(cls, fully_qualified=False)
            excp.raise_with_cause(excp.InvalidFormat,
                                  "%s message response data not of the"
                                  " expected format: %s" % (cls_name,
                                                            e.message),
                                  cause=e)
        else:
            state = data['state']
            if state == FAILURE and 'result' in data:
                ft.Failure.validate(data['result'])
dataset/ETHPy150Open openstack/taskflow/taskflow/engines/worker_based/protocol.py/Response.validate/original