===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/__init__.py ===== ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/BaseService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): """ the BaseService is defined for management purpose, such as check alive. """ def ping(self): """ for checking alive """ pass class Client(Iface): """ the BaseService is defined for management purpose, such as check alive. """ def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def ping(self): """ for checking alive """ self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["ping"] = Processor.process_ping def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/dto/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/dto/__init__.py ===== __all__ = ['ttypes', 'constants'] ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/dto/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport all_structs = [] class Result(object): """ common result Attributes: - success - code - message """ def __init__(self, success=None, code=None, message=None,): self.success = success self.code = code self.message = message def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.code = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 1) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.code is not None: oprot.writeFieldBegin('code', TType.I32, 2) oprot.writeI32(self.code) oprot.writeFieldEnd() if self.message is not None: oprot.writeFieldBegin('message', TType.STRING, 3) oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.success is None: raise TProtocolException(message='Required field success is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ClassifyAlgoResult(object): """ Attributes: - propValueId - propValueName - confidence """ def __init__(self, propValueId=None, propValueName=None, confidence=None,): self.propValueId = propValueId self.propValueName = propValueName self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.propValueId = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.propValueName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ClassifyAlgoResult') if self.propValueId is not None: oprot.writeFieldBegin('propValueId', TType.I32, 1) oprot.writeI32(self.propValueId) oprot.writeFieldEnd() if self.propValueName is not None: oprot.writeFieldBegin('propValueName', TType.STRING, 2) oprot.writeString(self.propValueName.encode('utf-8') if sys.version_info[0] == 2 else self.propValueName) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CommentRequest(object): """ Attributes: - text - sameAuthor - contextText - brandAuthor - noteContentText - noteImgEmbed - historyContentText - noteId - noteType - imageList - keyFrameList - userFeatureJson - FeatureJson """ def __init__(self, text=None, sameAuthor=None, contextText=None, brandAuthor=None, noteContentText=None, noteImgEmbed=None, historyContentText=None, noteId=None, noteType=None, imageList=None, keyFrameList=None, userFeatureJson=None, FeatureJson=None,): self.text = text self.sameAuthor = sameAuthor self.contextText = contextText self.brandAuthor = brandAuthor self.noteContentText = noteContentText self.noteImgEmbed = noteImgEmbed self.historyContentText = historyContentText self.noteId = noteId self.noteType = noteType self.imageList = imageList self.keyFrameList = keyFrameList self.userFeatureJson = userFeatureJson self.FeatureJson = FeatureJson def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: self.sameAuthor = iprot.readBool() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.contextText = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.brandAuthor = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.noteContentText = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.noteImgEmbed = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = iprot.readDouble() self.noteImgEmbed.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.historyContentText = [] (_etype9, _size6) = iprot.readListBegin() for _i10 in range(_size6): _elem11 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.historyContentText.append(_elem11) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.noteType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.imageList = [] (_etype15, _size12) = iprot.readListBegin() for _i16 in range(_size12): _elem17 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem17) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.keyFrameList = [] (_etype21, _size18) = iprot.readListBegin() for _i22 in range(_size18): _elem23 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem23) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.userFeatureJson = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.FeatureJson = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CommentRequest') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.sameAuthor is not None: oprot.writeFieldBegin('sameAuthor', TType.BOOL, 2) oprot.writeBool(self.sameAuthor) oprot.writeFieldEnd() if self.contextText is not None: oprot.writeFieldBegin('contextText', TType.STRING, 3) oprot.writeString(self.contextText.encode('utf-8') if sys.version_info[0] == 2 else self.contextText) oprot.writeFieldEnd() if self.brandAuthor is not None: oprot.writeFieldBegin('brandAuthor', TType.BOOL, 4) oprot.writeBool(self.brandAuthor) oprot.writeFieldEnd() if self.noteContentText is not None: oprot.writeFieldBegin('noteContentText', TType.STRING, 5) oprot.writeString(self.noteContentText.encode('utf-8') if sys.version_info[0] == 2 else self.noteContentText) oprot.writeFieldEnd() if self.noteImgEmbed is not None: oprot.writeFieldBegin('noteImgEmbed', TType.LIST, 6) oprot.writeListBegin(TType.DOUBLE, len(self.noteImgEmbed)) for iter24 in self.noteImgEmbed: oprot.writeDouble(iter24) oprot.writeListEnd() oprot.writeFieldEnd() if self.historyContentText is not None: oprot.writeFieldBegin('historyContentText', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.historyContentText)) for iter25 in self.historyContentText: oprot.writeString(iter25.encode('utf-8') if sys.version_info[0] == 2 else iter25) oprot.writeListEnd() oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 8) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.STRING, 9) oprot.writeString(self.noteType.encode('utf-8') if sys.version_info[0] == 2 else self.noteType) oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter26 in self.imageList: oprot.writeString(iter26.encode('utf-8') if sys.version_info[0] == 2 else iter26) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter27 in self.keyFrameList: oprot.writeString(iter27.encode('utf-8') if sys.version_info[0] == 2 else iter27) oprot.writeListEnd() oprot.writeFieldEnd() if self.userFeatureJson is not None: oprot.writeFieldBegin('userFeatureJson', TType.STRING, 12) oprot.writeString(self.userFeatureJson.encode('utf-8') if sys.version_info[0] == 2 else self.userFeatureJson) oprot.writeFieldEnd() if self.FeatureJson is not None: oprot.writeFieldBegin('FeatureJson', TType.STRING, 13) oprot.writeString(self.FeatureJson.encode('utf-8') if sys.version_info[0] == 2 else self.FeatureJson) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CommentResult(object): """ Attributes: - unkind - low - political - insult - ads_v2 - ads_v3 - unkind_v2 - insult_v2 - low_v2 - meaning - ads - unkind_v3 - illegal - meaning_v2 - political_v2 - political_v3 - meaning_v3 - low_v3 - ads_v4 - unkind_v4 - low_v4 - insult_v3 - ad_in - porn - harass - comment_order - unkind_v5 - ads_v5 - unkind_v6 - ads_v6 - comment_order_pos - unkind_v7 - intent - sentiment - unkind_v8 - unfriendly_v2 - intent_v2 - sentiment_v2 - emotion - conflict - conflict_topic - comment_like - comment_reply - comment_report - unkind_v9 """ def __init__(self, unkind=None, low=None, political=None, insult=None, ads_v2=None, ads_v3=None, unkind_v2=None, insult_v2=None, low_v2=None, meaning=None, ads=None, unkind_v3=None, illegal=None, meaning_v2=None, political_v2=None, political_v3=None, meaning_v3=None, low_v3=None, ads_v4=None, unkind_v4=None, low_v4=None, insult_v3=None, ad_in=None, porn=None, harass=None, comment_order=None, unkind_v5=None, ads_v5=None, unkind_v6=None, ads_v6=None, comment_order_pos=None, unkind_v7=None, intent=None, sentiment=None, unkind_v8=None, unfriendly_v2=None, intent_v2=None, sentiment_v2=None, emotion=None, conflict=None, conflict_topic=None, comment_like=None, comment_reply=None, comment_report=None, unkind_v9=None,): self.unkind = unkind self.low = low self.political = political self.insult = insult self.ads_v2 = ads_v2 self.ads_v3 = ads_v3 self.unkind_v2 = unkind_v2 self.insult_v2 = insult_v2 self.low_v2 = low_v2 self.meaning = meaning self.ads = ads self.unkind_v3 = unkind_v3 self.illegal = illegal self.meaning_v2 = meaning_v2 self.political_v2 = political_v2 self.political_v3 = political_v3 self.meaning_v3 = meaning_v3 self.low_v3 = low_v3 self.ads_v4 = ads_v4 self.unkind_v4 = unkind_v4 self.low_v4 = low_v4 self.insult_v3 = insult_v3 self.ad_in = ad_in self.porn = porn self.harass = harass self.comment_order = comment_order self.unkind_v5 = unkind_v5 self.ads_v5 = ads_v5 self.unkind_v6 = unkind_v6 self.ads_v6 = ads_v6 self.comment_order_pos = comment_order_pos self.unkind_v7 = unkind_v7 self.intent = intent self.sentiment = sentiment self.unkind_v8 = unkind_v8 self.unfriendly_v2 = unfriendly_v2 self.intent_v2 = intent_v2 self.sentiment_v2 = sentiment_v2 self.emotion = emotion self.conflict = conflict self.conflict_topic = conflict_topic self.comment_like = comment_like self.comment_reply = comment_reply self.comment_report = comment_report self.unkind_v9 = unkind_v9 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.unkind = iprot.readDouble() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.low = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.political = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.insult = iprot.readDouble() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.DOUBLE: self.ads_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.ads_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.DOUBLE: self.unkind_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.DOUBLE: self.insult_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.DOUBLE: self.low_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.DOUBLE: self.meaning = iprot.readDouble() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.DOUBLE: self.ads = iprot.readDouble() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.DOUBLE: self.unkind_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.DOUBLE: self.illegal = iprot.readDouble() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.DOUBLE: self.meaning_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.DOUBLE: self.political_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 16: if ftype == TType.DOUBLE: self.political_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 17: if ftype == TType.DOUBLE: self.meaning_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 18: if ftype == TType.DOUBLE: self.low_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 19: if ftype == TType.DOUBLE: self.ads_v4 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 20: if ftype == TType.DOUBLE: self.unkind_v4 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 21: if ftype == TType.DOUBLE: self.low_v4 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 22: if ftype == TType.DOUBLE: self.insult_v3 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 23: if ftype == TType.DOUBLE: self.ad_in = iprot.readDouble() else: iprot.skip(ftype) elif fid == 24: if ftype == TType.DOUBLE: self.porn = iprot.readDouble() else: iprot.skip(ftype) elif fid == 25: if ftype == TType.DOUBLE: self.harass = iprot.readDouble() else: iprot.skip(ftype) elif fid == 26: if ftype == TType.DOUBLE: self.comment_order = iprot.readDouble() else: iprot.skip(ftype) elif fid == 27: if ftype == TType.DOUBLE: self.unkind_v5 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 28: if ftype == TType.DOUBLE: self.ads_v5 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 29: if ftype == TType.DOUBLE: self.unkind_v6 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 30: if ftype == TType.DOUBLE: self.ads_v6 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 31: if ftype == TType.DOUBLE: self.comment_order_pos = iprot.readDouble() else: iprot.skip(ftype) elif fid == 32: if ftype == TType.DOUBLE: self.unkind_v7 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 33: if ftype == TType.STRING: self.intent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 34: if ftype == TType.STRING: self.sentiment = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 35: if ftype == TType.DOUBLE: self.unkind_v8 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 36: if ftype == TType.DOUBLE: self.unfriendly_v2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 37: if ftype == TType.STRING: self.intent_v2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 38: if ftype == TType.STRING: self.sentiment_v2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 39: if ftype == TType.STRING: self.emotion = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 40: if ftype == TType.STRING: self.conflict = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 41: if ftype == TType.STRING: self.conflict_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 42: if ftype == TType.DOUBLE: self.comment_like = iprot.readDouble() else: iprot.skip(ftype) elif fid == 43: if ftype == TType.DOUBLE: self.comment_reply = iprot.readDouble() else: iprot.skip(ftype) elif fid == 44: if ftype == TType.DOUBLE: self.comment_report = iprot.readDouble() else: iprot.skip(ftype) elif fid == 45: if ftype == TType.DOUBLE: self.unkind_v9 = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CommentResult') if self.unkind is not None: oprot.writeFieldBegin('unkind', TType.DOUBLE, 1) oprot.writeDouble(self.unkind) oprot.writeFieldEnd() if self.low is not None: oprot.writeFieldBegin('low', TType.DOUBLE, 2) oprot.writeDouble(self.low) oprot.writeFieldEnd() if self.political is not None: oprot.writeFieldBegin('political', TType.DOUBLE, 3) oprot.writeDouble(self.political) oprot.writeFieldEnd() if self.insult is not None: oprot.writeFieldBegin('insult', TType.DOUBLE, 4) oprot.writeDouble(self.insult) oprot.writeFieldEnd() if self.ads_v2 is not None: oprot.writeFieldBegin('ads_v2', TType.DOUBLE, 5) oprot.writeDouble(self.ads_v2) oprot.writeFieldEnd() if self.ads_v3 is not None: oprot.writeFieldBegin('ads_v3', TType.DOUBLE, 6) oprot.writeDouble(self.ads_v3) oprot.writeFieldEnd() if self.unkind_v2 is not None: oprot.writeFieldBegin('unkind_v2', TType.DOUBLE, 7) oprot.writeDouble(self.unkind_v2) oprot.writeFieldEnd() if self.insult_v2 is not None: oprot.writeFieldBegin('insult_v2', TType.DOUBLE, 8) oprot.writeDouble(self.insult_v2) oprot.writeFieldEnd() if self.low_v2 is not None: oprot.writeFieldBegin('low_v2', TType.DOUBLE, 9) oprot.writeDouble(self.low_v2) oprot.writeFieldEnd() if self.meaning is not None: oprot.writeFieldBegin('meaning', TType.DOUBLE, 10) oprot.writeDouble(self.meaning) oprot.writeFieldEnd() if self.ads is not None: oprot.writeFieldBegin('ads', TType.DOUBLE, 11) oprot.writeDouble(self.ads) oprot.writeFieldEnd() if self.unkind_v3 is not None: oprot.writeFieldBegin('unkind_v3', TType.DOUBLE, 12) oprot.writeDouble(self.unkind_v3) oprot.writeFieldEnd() if self.illegal is not None: oprot.writeFieldBegin('illegal', TType.DOUBLE, 13) oprot.writeDouble(self.illegal) oprot.writeFieldEnd() if self.meaning_v2 is not None: oprot.writeFieldBegin('meaning_v2', TType.DOUBLE, 14) oprot.writeDouble(self.meaning_v2) oprot.writeFieldEnd() if self.political_v2 is not None: oprot.writeFieldBegin('political_v2', TType.DOUBLE, 15) oprot.writeDouble(self.political_v2) oprot.writeFieldEnd() if self.political_v3 is not None: oprot.writeFieldBegin('political_v3', TType.DOUBLE, 16) oprot.writeDouble(self.political_v3) oprot.writeFieldEnd() if self.meaning_v3 is not None: oprot.writeFieldBegin('meaning_v3', TType.DOUBLE, 17) oprot.writeDouble(self.meaning_v3) oprot.writeFieldEnd() if self.low_v3 is not None: oprot.writeFieldBegin('low_v3', TType.DOUBLE, 18) oprot.writeDouble(self.low_v3) oprot.writeFieldEnd() if self.ads_v4 is not None: oprot.writeFieldBegin('ads_v4', TType.DOUBLE, 19) oprot.writeDouble(self.ads_v4) oprot.writeFieldEnd() if self.unkind_v4 is not None: oprot.writeFieldBegin('unkind_v4', TType.DOUBLE, 20) oprot.writeDouble(self.unkind_v4) oprot.writeFieldEnd() if self.low_v4 is not None: oprot.writeFieldBegin('low_v4', TType.DOUBLE, 21) oprot.writeDouble(self.low_v4) oprot.writeFieldEnd() if self.insult_v3 is not None: oprot.writeFieldBegin('insult_v3', TType.DOUBLE, 22) oprot.writeDouble(self.insult_v3) oprot.writeFieldEnd() if self.ad_in is not None: oprot.writeFieldBegin('ad_in', TType.DOUBLE, 23) oprot.writeDouble(self.ad_in) oprot.writeFieldEnd() if self.porn is not None: oprot.writeFieldBegin('porn', TType.DOUBLE, 24) oprot.writeDouble(self.porn) oprot.writeFieldEnd() if self.harass is not None: oprot.writeFieldBegin('harass', TType.DOUBLE, 25) oprot.writeDouble(self.harass) oprot.writeFieldEnd() if self.comment_order is not None: oprot.writeFieldBegin('comment_order', TType.DOUBLE, 26) oprot.writeDouble(self.comment_order) oprot.writeFieldEnd() if self.unkind_v5 is not None: oprot.writeFieldBegin('unkind_v5', TType.DOUBLE, 27) oprot.writeDouble(self.unkind_v5) oprot.writeFieldEnd() if self.ads_v5 is not None: oprot.writeFieldBegin('ads_v5', TType.DOUBLE, 28) oprot.writeDouble(self.ads_v5) oprot.writeFieldEnd() if self.unkind_v6 is not None: oprot.writeFieldBegin('unkind_v6', TType.DOUBLE, 29) oprot.writeDouble(self.unkind_v6) oprot.writeFieldEnd() if self.ads_v6 is not None: oprot.writeFieldBegin('ads_v6', TType.DOUBLE, 30) oprot.writeDouble(self.ads_v6) oprot.writeFieldEnd() if self.comment_order_pos is not None: oprot.writeFieldBegin('comment_order_pos', TType.DOUBLE, 31) oprot.writeDouble(self.comment_order_pos) oprot.writeFieldEnd() if self.unkind_v7 is not None: oprot.writeFieldBegin('unkind_v7', TType.DOUBLE, 32) oprot.writeDouble(self.unkind_v7) oprot.writeFieldEnd() if self.intent is not None: oprot.writeFieldBegin('intent', TType.STRING, 33) oprot.writeString(self.intent.encode('utf-8') if sys.version_info[0] == 2 else self.intent) oprot.writeFieldEnd() if self.sentiment is not None: oprot.writeFieldBegin('sentiment', TType.STRING, 34) oprot.writeString(self.sentiment.encode('utf-8') if sys.version_info[0] == 2 else self.sentiment) oprot.writeFieldEnd() if self.unkind_v8 is not None: oprot.writeFieldBegin('unkind_v8', TType.DOUBLE, 35) oprot.writeDouble(self.unkind_v8) oprot.writeFieldEnd() if self.unfriendly_v2 is not None: oprot.writeFieldBegin('unfriendly_v2', TType.DOUBLE, 36) oprot.writeDouble(self.unfriendly_v2) oprot.writeFieldEnd() if self.intent_v2 is not None: oprot.writeFieldBegin('intent_v2', TType.STRING, 37) oprot.writeString(self.intent_v2.encode('utf-8') if sys.version_info[0] == 2 else self.intent_v2) oprot.writeFieldEnd() if self.sentiment_v2 is not None: oprot.writeFieldBegin('sentiment_v2', TType.STRING, 38) oprot.writeString(self.sentiment_v2.encode('utf-8') if sys.version_info[0] == 2 else self.sentiment_v2) oprot.writeFieldEnd() if self.emotion is not None: oprot.writeFieldBegin('emotion', TType.STRING, 39) oprot.writeString(self.emotion.encode('utf-8') if sys.version_info[0] == 2 else self.emotion) oprot.writeFieldEnd() if self.conflict is not None: oprot.writeFieldBegin('conflict', TType.STRING, 40) oprot.writeString(self.conflict.encode('utf-8') if sys.version_info[0] == 2 else self.conflict) oprot.writeFieldEnd() if self.conflict_topic is not None: oprot.writeFieldBegin('conflict_topic', TType.STRING, 41) oprot.writeString(self.conflict_topic.encode('utf-8') if sys.version_info[0] == 2 else self.conflict_topic) oprot.writeFieldEnd() if self.comment_like is not None: oprot.writeFieldBegin('comment_like', TType.DOUBLE, 42) oprot.writeDouble(self.comment_like) oprot.writeFieldEnd() if self.comment_reply is not None: oprot.writeFieldBegin('comment_reply', TType.DOUBLE, 43) oprot.writeDouble(self.comment_reply) oprot.writeFieldEnd() if self.comment_report is not None: oprot.writeFieldBegin('comment_report', TType.DOUBLE, 44) oprot.writeDouble(self.comment_report) oprot.writeFieldEnd() if self.unkind_v9 is not None: oprot.writeFieldBegin('unkind_v9', TType.DOUBLE, 45) oprot.writeDouble(self.unkind_v9) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DanmuRequest(object): """ Attributes: - text """ def __init__(self, text=None,): self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DanmuRequest') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DanmuResult(object): """ Attributes: - label - confidence """ def __init__(self, label=None, confidence=None,): self.label = label self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DanmuResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.label is None: raise TProtocolException(message='Required field label is unset!') if self.confidence is None: raise TProtocolException(message='Required field confidence is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TaxonomyResult(object): """ Attributes: - lv1_top1_taxonomy - lv1_top1_score - lv1_top2_taxonomy - lv1_top2_score - lv2_top1_taxonomy - lv2_top1_score - lv2_top2_taxonomy - lv2_top2_score - final_top1_taxonomy - final_top2_taxonomy """ def __init__(self, lv1_top1_taxonomy=None, lv1_top1_score=None, lv1_top2_taxonomy=None, lv1_top2_score=None, lv2_top1_taxonomy=None, lv2_top1_score=None, lv2_top2_taxonomy=None, lv2_top2_score=None, final_top1_taxonomy=None, final_top2_taxonomy=None,): self.lv1_top1_taxonomy = lv1_top1_taxonomy self.lv1_top1_score = lv1_top1_score self.lv1_top2_taxonomy = lv1_top2_taxonomy self.lv1_top2_score = lv1_top2_score self.lv2_top1_taxonomy = lv2_top1_taxonomy self.lv2_top1_score = lv2_top1_score self.lv2_top2_taxonomy = lv2_top2_taxonomy self.lv2_top2_score = lv2_top2_score self.final_top1_taxonomy = final_top1_taxonomy self.final_top2_taxonomy = final_top2_taxonomy def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.lv1_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.lv1_top1_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.lv1_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.lv1_top2_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.lv2_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.lv2_top1_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.lv2_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.DOUBLE: self.lv2_top2_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.final_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: self.final_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TaxonomyResult') if self.lv1_top1_taxonomy is not None: oprot.writeFieldBegin('lv1_top1_taxonomy', TType.STRING, 1) oprot.writeString(self.lv1_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv1_top1_taxonomy) oprot.writeFieldEnd() if self.lv1_top1_score is not None: oprot.writeFieldBegin('lv1_top1_score', TType.DOUBLE, 2) oprot.writeDouble(self.lv1_top1_score) oprot.writeFieldEnd() if self.lv1_top2_taxonomy is not None: oprot.writeFieldBegin('lv1_top2_taxonomy', TType.STRING, 3) oprot.writeString(self.lv1_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv1_top2_taxonomy) oprot.writeFieldEnd() if self.lv1_top2_score is not None: oprot.writeFieldBegin('lv1_top2_score', TType.DOUBLE, 4) oprot.writeDouble(self.lv1_top2_score) oprot.writeFieldEnd() if self.lv2_top1_taxonomy is not None: oprot.writeFieldBegin('lv2_top1_taxonomy', TType.STRING, 5) oprot.writeString(self.lv2_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv2_top1_taxonomy) oprot.writeFieldEnd() if self.lv2_top1_score is not None: oprot.writeFieldBegin('lv2_top1_score', TType.DOUBLE, 6) oprot.writeDouble(self.lv2_top1_score) oprot.writeFieldEnd() if self.lv2_top2_taxonomy is not None: oprot.writeFieldBegin('lv2_top2_taxonomy', TType.STRING, 7) oprot.writeString(self.lv2_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv2_top2_taxonomy) oprot.writeFieldEnd() if self.lv2_top2_score is not None: oprot.writeFieldBegin('lv2_top2_score', TType.DOUBLE, 8) oprot.writeDouble(self.lv2_top2_score) oprot.writeFieldEnd() if self.final_top1_taxonomy is not None: oprot.writeFieldBegin('final_top1_taxonomy', TType.STRING, 9) oprot.writeString(self.final_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.final_top1_taxonomy) oprot.writeFieldEnd() if self.final_top2_taxonomy is not None: oprot.writeFieldBegin('final_top2_taxonomy', TType.STRING, 10) oprot.writeString(self.final_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.final_top2_taxonomy) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TaxonomyV2Result(object): """ Attributes: - lv1_top1_taxonomy - lv1_top1_score - lv1_top2_taxonomy - lv1_top2_score - lv2_top1_taxonomy - lv2_top1_score - lv2_top2_taxonomy - lv2_top2_score - lv3_top1_taxonomy - lv3_top1_score - lv3_top2_taxonomy - lv3_top2_score - final_top1_taxonomy - final_top2_taxonomy - final_top3_taxonomy """ def __init__(self, lv1_top1_taxonomy=None, lv1_top1_score=None, lv1_top2_taxonomy=None, lv1_top2_score=None, lv2_top1_taxonomy=None, lv2_top1_score=None, lv2_top2_taxonomy=None, lv2_top2_score=None, lv3_top1_taxonomy=None, lv3_top1_score=None, lv3_top2_taxonomy=None, lv3_top2_score=None, final_top1_taxonomy=None, final_top2_taxonomy=None, final_top3_taxonomy=None,): self.lv1_top1_taxonomy = lv1_top1_taxonomy self.lv1_top1_score = lv1_top1_score self.lv1_top2_taxonomy = lv1_top2_taxonomy self.lv1_top2_score = lv1_top2_score self.lv2_top1_taxonomy = lv2_top1_taxonomy self.lv2_top1_score = lv2_top1_score self.lv2_top2_taxonomy = lv2_top2_taxonomy self.lv2_top2_score = lv2_top2_score self.lv3_top1_taxonomy = lv3_top1_taxonomy self.lv3_top1_score = lv3_top1_score self.lv3_top2_taxonomy = lv3_top2_taxonomy self.lv3_top2_score = lv3_top2_score self.final_top1_taxonomy = final_top1_taxonomy self.final_top2_taxonomy = final_top2_taxonomy self.final_top3_taxonomy = final_top3_taxonomy def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.lv1_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.lv1_top1_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.lv1_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.lv1_top2_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.lv2_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.lv2_top1_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.lv2_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.DOUBLE: self.lv2_top2_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.lv3_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.DOUBLE: self.lv3_top1_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.lv3_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.DOUBLE: self.lv3_top2_score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.final_top1_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: self.final_top2_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.STRING: self.final_top3_taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TaxonomyV2Result') if self.lv1_top1_taxonomy is not None: oprot.writeFieldBegin('lv1_top1_taxonomy', TType.STRING, 1) oprot.writeString(self.lv1_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv1_top1_taxonomy) oprot.writeFieldEnd() if self.lv1_top1_score is not None: oprot.writeFieldBegin('lv1_top1_score', TType.DOUBLE, 2) oprot.writeDouble(self.lv1_top1_score) oprot.writeFieldEnd() if self.lv1_top2_taxonomy is not None: oprot.writeFieldBegin('lv1_top2_taxonomy', TType.STRING, 3) oprot.writeString(self.lv1_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv1_top2_taxonomy) oprot.writeFieldEnd() if self.lv1_top2_score is not None: oprot.writeFieldBegin('lv1_top2_score', TType.DOUBLE, 4) oprot.writeDouble(self.lv1_top2_score) oprot.writeFieldEnd() if self.lv2_top1_taxonomy is not None: oprot.writeFieldBegin('lv2_top1_taxonomy', TType.STRING, 5) oprot.writeString(self.lv2_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv2_top1_taxonomy) oprot.writeFieldEnd() if self.lv2_top1_score is not None: oprot.writeFieldBegin('lv2_top1_score', TType.DOUBLE, 6) oprot.writeDouble(self.lv2_top1_score) oprot.writeFieldEnd() if self.lv2_top2_taxonomy is not None: oprot.writeFieldBegin('lv2_top2_taxonomy', TType.STRING, 7) oprot.writeString(self.lv2_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv2_top2_taxonomy) oprot.writeFieldEnd() if self.lv2_top2_score is not None: oprot.writeFieldBegin('lv2_top2_score', TType.DOUBLE, 8) oprot.writeDouble(self.lv2_top2_score) oprot.writeFieldEnd() if self.lv3_top1_taxonomy is not None: oprot.writeFieldBegin('lv3_top1_taxonomy', TType.STRING, 9) oprot.writeString(self.lv3_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv3_top1_taxonomy) oprot.writeFieldEnd() if self.lv3_top1_score is not None: oprot.writeFieldBegin('lv3_top1_score', TType.DOUBLE, 10) oprot.writeDouble(self.lv3_top1_score) oprot.writeFieldEnd() if self.lv3_top2_taxonomy is not None: oprot.writeFieldBegin('lv3_top2_taxonomy', TType.STRING, 11) oprot.writeString(self.lv3_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.lv3_top2_taxonomy) oprot.writeFieldEnd() if self.lv3_top2_score is not None: oprot.writeFieldBegin('lv3_top2_score', TType.DOUBLE, 12) oprot.writeDouble(self.lv3_top2_score) oprot.writeFieldEnd() if self.final_top1_taxonomy is not None: oprot.writeFieldBegin('final_top1_taxonomy', TType.STRING, 13) oprot.writeString(self.final_top1_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.final_top1_taxonomy) oprot.writeFieldEnd() if self.final_top2_taxonomy is not None: oprot.writeFieldBegin('final_top2_taxonomy', TType.STRING, 14) oprot.writeString(self.final_top2_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.final_top2_taxonomy) oprot.writeFieldEnd() if self.final_top3_taxonomy is not None: oprot.writeFieldBegin('final_top3_taxonomy', TType.STRING, 15) oprot.writeString(self.final_top3_taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.final_top3_taxonomy) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CustomerConversationTurn(object): """ Attributes: - sender_type - content_type - content """ def __init__(self, sender_type=None, content_type=None, content=None,): self.sender_type = sender_type self.content_type = content_type self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.sender_type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.content_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CustomerConversationTurn') if self.sender_type is not None: oprot.writeFieldBegin('sender_type', TType.STRING, 1) oprot.writeString(self.sender_type.encode('utf-8') if sys.version_info[0] == 2 else self.sender_type) oprot.writeFieldEnd() if self.content_type is not None: oprot.writeFieldBegin('content_type', TType.I32, 2) oprot.writeI32(self.content_type) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AudioResult(object): """ Attributes: - noteId - musicId - musicIdNoteId """ def __init__(self, noteId=None, musicId=None, musicIdNoteId=None,): self.noteId = noteId self.musicId = musicId self.musicIdNoteId = musicIdNoteId def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.musicId = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.musicIdNoteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AudioResult') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.musicId is not None: oprot.writeFieldBegin('musicId', TType.I32, 2) oprot.writeI32(self.musicId) oprot.writeFieldEnd() if self.musicIdNoteId is not None: oprot.writeFieldBegin('musicIdNoteId', TType.STRING, 3) oprot.writeString(self.musicIdNoteId.encode('utf-8') if sys.version_info[0] == 2 else self.musicIdNoteId) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AiGoTrainConfig(object): """ Attributes: - modelName - epoch - batchSize - testSplit """ def __init__(self, modelName=None, epoch=None, batchSize=None, testSplit=None,): self.modelName = modelName self.epoch = epoch self.batchSize = batchSize self.testSplit = testSplit def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.modelName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.epoch = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.batchSize = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.testSplit = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AiGoTrainConfig') if self.modelName is not None: oprot.writeFieldBegin('modelName', TType.STRING, 1) oprot.writeString(self.modelName.encode('utf-8') if sys.version_info[0] == 2 else self.modelName) oprot.writeFieldEnd() if self.epoch is not None: oprot.writeFieldBegin('epoch', TType.I32, 2) oprot.writeI32(self.epoch) oprot.writeFieldEnd() if self.batchSize is not None: oprot.writeFieldBegin('batchSize', TType.I32, 3) oprot.writeI32(self.batchSize) oprot.writeFieldEnd() if self.testSplit is not None: oprot.writeFieldBegin('testSplit', TType.DOUBLE, 4) oprot.writeDouble(self.testSplit) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AigoTrainResult(object): """ Attributes: - acc - modelPath - modelVersion - accuracy """ def __init__(self, acc=None, modelPath=None, modelVersion=None, accuracy=None,): self.acc = acc self.modelPath = modelPath self.modelVersion = modelVersion self.accuracy = accuracy def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.acc = {} (_ktype29, _vtype30, _size28) = iprot.readMapBegin() for _i32 in range(_size28): _key33 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val34 = iprot.readDouble() self.acc[_key33] = _val34 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.modelPath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.modelVersion = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.accuracy = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AigoTrainResult') if self.acc is not None: oprot.writeFieldBegin('acc', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.acc)) for kiter35, viter36 in self.acc.items(): oprot.writeString(kiter35.encode('utf-8') if sys.version_info[0] == 2 else kiter35) oprot.writeDouble(viter36) oprot.writeMapEnd() oprot.writeFieldEnd() if self.modelPath is not None: oprot.writeFieldBegin('modelPath', TType.STRING, 2) oprot.writeString(self.modelPath.encode('utf-8') if sys.version_info[0] == 2 else self.modelPath) oprot.writeFieldEnd() if self.modelVersion is not None: oprot.writeFieldBegin('modelVersion', TType.STRING, 3) oprot.writeString(self.modelVersion.encode('utf-8') if sys.version_info[0] == 2 else self.modelVersion) oprot.writeFieldEnd() if self.accuracy is not None: oprot.writeFieldBegin('accuracy', TType.DOUBLE, 4) oprot.writeDouble(self.accuracy) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AigoMaterial(object): """ Attributes: - materialId - outerId - content """ def __init__(self, materialId=None, outerId=None, content=None,): self.materialId = materialId self.outerId = outerId self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.materialId = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.outerId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AigoMaterial') if self.materialId is not None: oprot.writeFieldBegin('materialId', TType.I64, 1) oprot.writeI64(self.materialId) oprot.writeFieldEnd() if self.outerId is not None: oprot.writeFieldBegin('outerId', TType.STRING, 2) oprot.writeString(self.outerId.encode('utf-8') if sys.version_info[0] == 2 else self.outerId) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AigoTestResult(object): """ Attributes: - materialId - label - result - confidence """ def __init__(self, materialId=None, label=None, result=None, confidence=None,): self.materialId = materialId self.label = label self.result = result self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.materialId = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.result = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AigoTestResult') if self.materialId is not None: oprot.writeFieldBegin('materialId', TType.I64, 1) oprot.writeI64(self.materialId) oprot.writeFieldEnd() if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 2) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.result is not None: oprot.writeFieldBegin('result', TType.STRING, 3) oprot.writeString(self.result.encode('utf-8') if sys.version_info[0] == 2 else self.result) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 4) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class KnowledgeResult(object): """ Attributes: - label - confidence """ def __init__(self, label=None, confidence=None,): self.label = label self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('KnowledgeResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteSecurityResult(object): """ Attributes: - label - category - confidence """ def __init__(self, label=None, category=None, confidence=None,): self.label = label self.category = category self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.category = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteSecurityResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.STRING, 2) oprot.writeString(self.category.encode('utf-8') if sys.version_info[0] == 2 else self.category) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class GiftBoxResult(object): """ Attributes: - label - category - confidence """ def __init__(self, label=None, category=None, confidence=None,): self.label = label self.category = category self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.category = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('GiftBoxResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.STRING, 2) oprot.writeString(self.category.encode('utf-8') if sys.version_info[0] == 2 else self.category) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AdvertiseResult(object): """ Attributes: - label - category - confidence """ def __init__(self, label=None, category=None, confidence=None,): self.label = label self.category = category self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.category = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AdvertiseResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.STRING, 2) oprot.writeString(self.category.encode('utf-8') if sys.version_info[0] == 2 else self.category) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FashionResult(object): """ Attributes: - label - category - confidence """ def __init__(self, label=None, category=None, confidence=None,): self.label = label self.category = category self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.category = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FashionResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.STRING, 2) oprot.writeString(self.category.encode('utf-8') if sys.version_info[0] == 2 else self.category) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FeedbackResult(object): """ Attributes: - categoryId - categoryName """ def __init__(self, categoryId=None, categoryName=None,): self.categoryId = categoryId self.categoryName = categoryName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.categoryId = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.categoryName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FeedbackResult') if self.categoryId is not None: oprot.writeFieldBegin('categoryId', TType.I32, 1) oprot.writeI32(self.categoryId) oprot.writeFieldEnd() if self.categoryName is not None: oprot.writeFieldBegin('categoryName', TType.STRING, 2) oprot.writeString(self.categoryName.encode('utf-8') if sys.version_info[0] == 2 else self.categoryName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EntityResult(object): """ Attributes: - startPos - endPos - name """ def __init__(self, startPos=None, endPos=None, name=None,): self.startPos = startPos self.endPos = endPos self.name = name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.startPos = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.endPos = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EntityResult') if self.startPos is not None: oprot.writeFieldBegin('startPos', TType.I32, 1) oprot.writeI32(self.startPos) oprot.writeFieldEnd() if self.endPos is not None: oprot.writeFieldBegin('endPos', TType.I32, 2) oprot.writeI32(self.endPos) oprot.writeFieldEnd() if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 3) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FaceResult(object): """ Attributes: - label - bbox - score - area """ def __init__(self, label=None, bbox=None, score=None, area=None,): self.label = label self.bbox = bbox self.score = score self.area = area def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.bbox = [] (_etype40, _size37) = iprot.readListBegin() for _i41 in range(_size37): _elem42 = iprot.readI32() self.bbox.append(_elem42) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.area = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FaceResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.bbox is not None: oprot.writeFieldBegin('bbox', TType.LIST, 2) oprot.writeListBegin(TType.I32, len(self.bbox)) for iter43 in self.bbox: oprot.writeI32(iter43) oprot.writeListEnd() oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.area is not None: oprot.writeFieldBegin('area', TType.DOUBLE, 4) oprot.writeDouble(self.area) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FaceRecognition(object): """ Attributes: - similarity - name - bbs - ccs """ def __init__(self, similarity=None, name=None, bbs=None, ccs=None,): self.similarity = similarity self.name = name self.bbs = bbs self.ccs = ccs def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.similarity = [] (_etype47, _size44) = iprot.readListBegin() for _i48 in range(_size44): _elem49 = iprot.readDouble() self.similarity.append(_elem49) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.name = [] (_etype53, _size50) = iprot.readListBegin() for _i54 in range(_size50): _elem55 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.name.append(_elem55) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.bbs = [] (_etype59, _size56) = iprot.readListBegin() for _i60 in range(_size56): _elem61 = [] (_etype65, _size62) = iprot.readListBegin() for _i66 in range(_size62): _elem67 = iprot.readI32() _elem61.append(_elem67) iprot.readListEnd() self.bbs.append(_elem61) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.ccs = [] (_etype71, _size68) = iprot.readListBegin() for _i72 in range(_size68): _elem73 = iprot.readDouble() self.ccs.append(_elem73) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FaceRecognition') if self.similarity is not None: oprot.writeFieldBegin('similarity', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.similarity)) for iter74 in self.similarity: oprot.writeDouble(iter74) oprot.writeListEnd() oprot.writeFieldEnd() if self.name is not None: oprot.writeFieldBegin('name', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.name)) for iter75 in self.name: oprot.writeString(iter75.encode('utf-8') if sys.version_info[0] == 2 else iter75) oprot.writeListEnd() oprot.writeFieldEnd() if self.bbs is not None: oprot.writeFieldBegin('bbs', TType.LIST, 3) oprot.writeListBegin(TType.LIST, len(self.bbs)) for iter76 in self.bbs: oprot.writeListBegin(TType.I32, len(iter76)) for iter77 in iter76: oprot.writeI32(iter77) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.ccs is not None: oprot.writeFieldBegin('ccs', TType.LIST, 4) oprot.writeListBegin(TType.DOUBLE, len(self.ccs)) for iter78 in self.ccs: oprot.writeDouble(iter78) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FaceRecognitionResult(object): """ Attributes: - bbox - kps - detScore - gender - age - name - similarity - embedding - area - label """ def __init__(self, bbox=None, kps=None, detScore=None, gender=None, age=None, name=None, similarity=None, embedding=None, area=None, label=None,): self.bbox = bbox self.kps = kps self.detScore = detScore self.gender = gender self.age = age self.name = name self.similarity = similarity self.embedding = embedding self.area = area self.label = label def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.bbox = [] (_etype82, _size79) = iprot.readListBegin() for _i83 in range(_size79): _elem84 = iprot.readDouble() self.bbox.append(_elem84) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.kps = [] (_etype88, _size85) = iprot.readListBegin() for _i89 in range(_size85): _elem90 = [] (_etype94, _size91) = iprot.readListBegin() for _i95 in range(_size91): _elem96 = iprot.readDouble() _elem90.append(_elem96) iprot.readListEnd() self.kps.append(_elem90) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.detScore = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.gender = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.age = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.DOUBLE: self.similarity = iprot.readDouble() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.embedding = [] (_etype100, _size97) = iprot.readListBegin() for _i101 in range(_size97): _elem102 = iprot.readDouble() self.embedding.append(_elem102) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.DOUBLE: self.area = iprot.readDouble() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FaceRecognitionResult') if self.bbox is not None: oprot.writeFieldBegin('bbox', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.bbox)) for iter103 in self.bbox: oprot.writeDouble(iter103) oprot.writeListEnd() oprot.writeFieldEnd() if self.kps is not None: oprot.writeFieldBegin('kps', TType.LIST, 2) oprot.writeListBegin(TType.LIST, len(self.kps)) for iter104 in self.kps: oprot.writeListBegin(TType.DOUBLE, len(iter104)) for iter105 in iter104: oprot.writeDouble(iter105) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.detScore is not None: oprot.writeFieldBegin('detScore', TType.DOUBLE, 3) oprot.writeDouble(self.detScore) oprot.writeFieldEnd() if self.gender is not None: oprot.writeFieldBegin('gender', TType.I32, 4) oprot.writeI32(self.gender) oprot.writeFieldEnd() if self.age is not None: oprot.writeFieldBegin('age', TType.I32, 5) oprot.writeI32(self.age) oprot.writeFieldEnd() if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 6) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.similarity is not None: oprot.writeFieldBegin('similarity', TType.DOUBLE, 7) oprot.writeDouble(self.similarity) oprot.writeFieldEnd() if self.embedding is not None: oprot.writeFieldBegin('embedding', TType.LIST, 8) oprot.writeListBegin(TType.DOUBLE, len(self.embedding)) for iter106 in self.embedding: oprot.writeDouble(iter106) oprot.writeListEnd() oprot.writeFieldEnd() if self.area is not None: oprot.writeFieldBegin('area', TType.DOUBLE, 9) oprot.writeDouble(self.area) oprot.writeFieldEnd() if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 10) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SimilarWord(object): """ Attributes: - word - similarity """ def __init__(self, word=None, similarity=None,): self.word = word self.similarity = similarity def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.word = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.similarity = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SimilarWord') if self.word is not None: oprot.writeFieldBegin('word', TType.STRING, 1) oprot.writeString(self.word.encode('utf-8') if sys.version_info[0] == 2 else self.word) oprot.writeFieldEnd() if self.similarity is not None: oprot.writeFieldBegin('similarity', TType.DOUBLE, 2) oprot.writeDouble(self.similarity) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ImageClassificationResult(object): """ Attributes: - name - confidence """ def __init__(self, name=None, confidence=None,): self.name = name self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ImageClassificationResult') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AestheticAssessmentResult(object): """ Attributes: - score - scores """ def __init__(self, score=None, scores=None,): self.score = score self.scores = scores def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.scores = [] (_etype110, _size107) = iprot.readListBegin() for _i111 in range(_size107): _elem112 = iprot.readDouble() self.scores.append(_elem112) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AestheticAssessmentResult') if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 1) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.scores is not None: oprot.writeFieldBegin('scores', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.scores)) for iter113 in self.scores: oprot.writeDouble(iter113) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CtrEmbeddingResult(object): """ Attributes: - ctrScore - ctrEmbedding """ def __init__(self, ctrScore=None, ctrEmbedding=None,): self.ctrScore = ctrScore self.ctrEmbedding = ctrEmbedding def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.ctrScore = iprot.readDouble() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.ctrEmbedding = [] (_etype117, _size114) = iprot.readListBegin() for _i118 in range(_size114): _elem119 = iprot.readDouble() self.ctrEmbedding.append(_elem119) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CtrEmbeddingResult') if self.ctrScore is not None: oprot.writeFieldBegin('ctrScore', TType.DOUBLE, 1) oprot.writeDouble(self.ctrScore) oprot.writeFieldEnd() if self.ctrEmbedding is not None: oprot.writeFieldBegin('ctrEmbedding', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.ctrEmbedding)) for iter120 in self.ctrEmbedding: oprot.writeDouble(iter120) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CtrRankingResult(object): """ Attributes: - orderedUrls - ctrScores """ def __init__(self, orderedUrls=None, ctrScores=None,): self.orderedUrls = orderedUrls self.ctrScores = ctrScores def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.orderedUrls = [] (_etype124, _size121) = iprot.readListBegin() for _i125 in range(_size121): _elem126 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.orderedUrls.append(_elem126) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.ctrScores = [] (_etype130, _size127) = iprot.readListBegin() for _i131 in range(_size127): _elem132 = iprot.readDouble() self.ctrScores.append(_elem132) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CtrRankingResult') if self.orderedUrls is not None: oprot.writeFieldBegin('orderedUrls', TType.LIST, 1) oprot.writeListBegin(TType.STRING, len(self.orderedUrls)) for iter133 in self.orderedUrls: oprot.writeString(iter133.encode('utf-8') if sys.version_info[0] == 2 else iter133) oprot.writeListEnd() oprot.writeFieldEnd() if self.ctrScores is not None: oprot.writeFieldBegin('ctrScores', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.ctrScores)) for iter134 in self.ctrScores: oprot.writeDouble(iter134) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class VideoTaggingResult(object): """ Attributes: - labels - scores - ids - enables """ def __init__(self, labels=None, scores=None, ids=None, enables=None,): self.labels = labels self.scores = scores self.ids = ids self.enables = enables def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.labels = [] (_etype138, _size135) = iprot.readListBegin() for _i139 in range(_size135): _elem140 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.labels.append(_elem140) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.scores = [] (_etype144, _size141) = iprot.readListBegin() for _i145 in range(_size141): _elem146 = iprot.readDouble() self.scores.append(_elem146) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.ids = [] (_etype150, _size147) = iprot.readListBegin() for _i151 in range(_size147): _elem152 = iprot.readI32() self.ids.append(_elem152) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.enables = [] (_etype156, _size153) = iprot.readListBegin() for _i157 in range(_size153): _elem158 = iprot.readBool() self.enables.append(_elem158) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('VideoTaggingResult') if self.labels is not None: oprot.writeFieldBegin('labels', TType.LIST, 1) oprot.writeListBegin(TType.STRING, len(self.labels)) for iter159 in self.labels: oprot.writeString(iter159.encode('utf-8') if sys.version_info[0] == 2 else iter159) oprot.writeListEnd() oprot.writeFieldEnd() if self.scores is not None: oprot.writeFieldBegin('scores', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.scores)) for iter160 in self.scores: oprot.writeDouble(iter160) oprot.writeListEnd() oprot.writeFieldEnd() if self.ids is not None: oprot.writeFieldBegin('ids', TType.LIST, 3) oprot.writeListBegin(TType.I32, len(self.ids)) for iter161 in self.ids: oprot.writeI32(iter161) oprot.writeListEnd() oprot.writeFieldEnd() if self.enables is not None: oprot.writeFieldBegin('enables', TType.LIST, 4) oprot.writeListBegin(TType.BOOL, len(self.enables)) for iter162 in self.enables: oprot.writeBool(iter162) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class MusicRec(object): """ Attributes: - musicId - similarity """ def __init__(self, musicId=None, similarity=None,): self.musicId = musicId self.similarity = similarity def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.musicId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.similarity = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('MusicRec') if self.musicId is not None: oprot.writeFieldBegin('musicId', TType.STRING, 1) oprot.writeString(self.musicId.encode('utf-8') if sys.version_info[0] == 2 else self.musicId) oprot.writeFieldEnd() if self.similarity is not None: oprot.writeFieldBegin('similarity', TType.DOUBLE, 2) oprot.writeDouble(self.similarity) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class UserClassificationRequest(object): """ Attributes: - userId - noteIds - imgUrls - keyFrames - titles - contents """ def __init__(self, userId=None, noteIds=None, imgUrls=None, keyFrames=None, titles=None, contents=None,): self.userId = userId self.noteIds = noteIds self.imgUrls = imgUrls self.keyFrames = keyFrames self.titles = titles self.contents = contents def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.userId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.noteIds = [] (_etype166, _size163) = iprot.readListBegin() for _i167 in range(_size163): _elem168 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.noteIds.append(_elem168) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.imgUrls = [] (_etype172, _size169) = iprot.readListBegin() for _i173 in range(_size169): _elem174 = [] (_etype178, _size175) = iprot.readListBegin() for _i179 in range(_size175): _elem180 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _elem174.append(_elem180) iprot.readListEnd() self.imgUrls.append(_elem174) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.keyFrames = [] (_etype184, _size181) = iprot.readListBegin() for _i185 in range(_size181): _elem186 = [] (_etype190, _size187) = iprot.readListBegin() for _i191 in range(_size187): _elem192 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _elem186.append(_elem192) iprot.readListEnd() self.keyFrames.append(_elem186) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titles = [] (_etype196, _size193) = iprot.readListBegin() for _i197 in range(_size193): _elem198 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titles.append(_elem198) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contents = [] (_etype202, _size199) = iprot.readListBegin() for _i203 in range(_size199): _elem204 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contents.append(_elem204) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('UserClassificationRequest') if self.userId is not None: oprot.writeFieldBegin('userId', TType.STRING, 1) oprot.writeString(self.userId.encode('utf-8') if sys.version_info[0] == 2 else self.userId) oprot.writeFieldEnd() if self.noteIds is not None: oprot.writeFieldBegin('noteIds', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.noteIds)) for iter205 in self.noteIds: oprot.writeString(iter205.encode('utf-8') if sys.version_info[0] == 2 else iter205) oprot.writeListEnd() oprot.writeFieldEnd() if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 3) oprot.writeListBegin(TType.LIST, len(self.imgUrls)) for iter206 in self.imgUrls: oprot.writeListBegin(TType.STRING, len(iter206)) for iter207 in iter206: oprot.writeString(iter207.encode('utf-8') if sys.version_info[0] == 2 else iter207) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrames is not None: oprot.writeFieldBegin('keyFrames', TType.LIST, 4) oprot.writeListBegin(TType.LIST, len(self.keyFrames)) for iter208 in self.keyFrames: oprot.writeListBegin(TType.STRING, len(iter208)) for iter209 in iter208: oprot.writeString(iter209.encode('utf-8') if sys.version_info[0] == 2 else iter209) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.titles is not None: oprot.writeFieldBegin('titles', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titles)) for iter210 in self.titles: oprot.writeString(iter210.encode('utf-8') if sys.version_info[0] == 2 else iter210) oprot.writeListEnd() oprot.writeFieldEnd() if self.contents is not None: oprot.writeFieldBegin('contents', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contents)) for iter211 in self.contents: oprot.writeString(iter211.encode('utf-8') if sys.version_info[0] == 2 else iter211) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AccusationResult(object): """ Attributes: - label - category - confidence """ def __init__(self, label=None, category=None, confidence=None,): self.label = label self.category = category self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.category = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AccusationResult') if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 1) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.STRING, 2) oprot.writeString(self.category.encode('utf-8') if sys.version_info[0] == 2 else self.category) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EcologyRequest(object): """ Attributes: - imgUrls - title - content """ def __init__(self, imgUrls=None, title=None, content=None,): self.imgUrls = imgUrls self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.imgUrls = [] (_etype215, _size212) = iprot.readListBegin() for _i216 in range(_size212): _elem217 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imgUrls.append(_elem217) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EcologyRequest') if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 1) oprot.writeListBegin(TType.STRING, len(self.imgUrls)) for iter218 in self.imgUrls: oprot.writeString(iter218.encode('utf-8') if sys.version_info[0] == 2 else iter218) oprot.writeListEnd() oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 2) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EcologyResult(object): """ Attributes: - propValueId - propValueName - confidence - qualityScore """ def __init__(self, propValueId=None, propValueName=None, confidence=None, qualityScore=None,): self.propValueId = propValueId self.propValueName = propValueName self.confidence = confidence self.qualityScore = qualityScore def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.propValueId = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.propValueName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.qualityScore = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EcologyResult') if self.propValueId is not None: oprot.writeFieldBegin('propValueId', TType.I32, 1) oprot.writeI32(self.propValueId) oprot.writeFieldEnd() if self.propValueName is not None: oprot.writeFieldBegin('propValueName', TType.STRING, 2) oprot.writeString(self.propValueName.encode('utf-8') if sys.version_info[0] == 2 else self.propValueName) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() if self.qualityScore is not None: oprot.writeFieldBegin('qualityScore', TType.DOUBLE, 4) oprot.writeDouble(self.qualityScore) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BboxResult(object): """ Attributes: - bbox - confidence - label - area """ def __init__(self, bbox=None, confidence=None, label=None, area=None,): self.bbox = bbox self.confidence = confidence self.label = label self.area = area def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.bbox = [] (_etype222, _size219) = iprot.readListBegin() for _i223 in range(_size219): _elem224 = iprot.readDouble() self.bbox.append(_elem224) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.area = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BboxResult') if self.bbox is not None: oprot.writeFieldBegin('bbox', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.bbox)) for iter225 in self.bbox: oprot.writeDouble(iter225) oprot.writeListEnd() oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 3) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.area is not None: oprot.writeFieldBegin('area', TType.DOUBLE, 4) oprot.writeDouble(self.area) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TagCorrelationRequest(object): """ Attributes: - noteId - noteType - tags - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, noteId=None, noteType=None, tags=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.noteId = noteId self.noteType = noteType self.tags = tags self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.tags = [] (_etype229, _size226) = iprot.readListBegin() for _i230 in range(_size226): _elem231 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.tags.append(_elem231) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype235, _size232) = iprot.readListBegin() for _i236 in range(_size232): _elem237 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem237) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype241, _size238) = iprot.readListBegin() for _i242 in range(_size238): _elem243 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem243) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype247, _size244) = iprot.readListBegin() for _i248 in range(_size244): _elem249 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem249) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype253, _size250) = iprot.readListBegin() for _i254 in range(_size250): _elem255 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem255) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.keyFrameList = [] (_etype259, _size256) = iprot.readListBegin() for _i260 in range(_size256): _elem261 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem261) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TagCorrelationRequest') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 2) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.tags is not None: oprot.writeFieldBegin('tags', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.tags)) for iter262 in self.tags: oprot.writeString(iter262.encode('utf-8') if sys.version_info[0] == 2 else iter262) oprot.writeListEnd() oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter263 in self.topicList: oprot.writeString(iter263.encode('utf-8') if sys.version_info[0] == 2 else iter263) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter264 in self.titleList: oprot.writeString(iter264.encode('utf-8') if sys.version_info[0] == 2 else iter264) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter265 in self.contentList: oprot.writeString(iter265.encode('utf-8') if sys.version_info[0] == 2 else iter265) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter266 in self.imageList: oprot.writeString(iter266.encode('utf-8') if sys.version_info[0] == 2 else iter266) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter267 in self.keyFrameList: oprot.writeString(iter267.encode('utf-8') if sys.version_info[0] == 2 else iter267) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.tags is None: raise TProtocolException(message='Required field tags is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TagCorrelationRequestV2(object): """ Attributes: - noteId - noteType - tags - topicList - title - content - imageList - keyFrameList """ def __init__(self, noteId=None, noteType=None, tags=None, topicList=None, title=None, content=None, imageList=None, keyFrameList=None,): self.noteId = noteId self.noteType = noteType self.tags = tags self.topicList = topicList self.title = title self.content = content self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.tags = [] (_etype271, _size268) = iprot.readListBegin() for _i272 in range(_size268): _elem273 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.tags.append(_elem273) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype277, _size274) = iprot.readListBegin() for _i278 in range(_size274): _elem279 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem279) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype283, _size280) = iprot.readListBegin() for _i284 in range(_size280): _elem285 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem285) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.keyFrameList = [] (_etype289, _size286) = iprot.readListBegin() for _i290 in range(_size286): _elem291 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem291) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TagCorrelationRequestV2') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 2) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.tags is not None: oprot.writeFieldBegin('tags', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.tags)) for iter292 in self.tags: oprot.writeString(iter292.encode('utf-8') if sys.version_info[0] == 2 else iter292) oprot.writeListEnd() oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter293 in self.topicList: oprot.writeString(iter293.encode('utf-8') if sys.version_info[0] == 2 else iter293) oprot.writeListEnd() oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 5) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 6) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter294 in self.imageList: oprot.writeString(iter294.encode('utf-8') if sys.version_info[0] == 2 else iter294) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter295 in self.keyFrameList: oprot.writeString(iter295.encode('utf-8') if sys.version_info[0] == 2 else iter295) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.tags is None: raise TProtocolException(message='Required field tags is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TagCorrelationResult(object): """ Attributes: - confidences """ def __init__(self, confidences=None,): self.confidences = confidences def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.confidences = {} (_ktype297, _vtype298, _size296) = iprot.readMapBegin() for _i300 in range(_size296): _key301 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val302 = iprot.readDouble() self.confidences[_key301] = _val302 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TagCorrelationResult') if self.confidences is not None: oprot.writeFieldBegin('confidences', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.confidences)) for kiter303, viter304 in self.confidences.items(): oprot.writeString(kiter303.encode('utf-8') if sys.version_info[0] == 2 else kiter303) oprot.writeDouble(viter304) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TagCorrelationResultV2(object): """ Attributes: - confidences """ def __init__(self, confidences=None,): self.confidences = confidences def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.confidences = {} (_ktype306, _vtype307, _size305) = iprot.readMapBegin() for _i309 in range(_size305): _key310 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val311 = iprot.readDouble() self.confidences[_key310] = _val311 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TagCorrelationResultV2') if self.confidences is not None: oprot.writeFieldBegin('confidences', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.confidences)) for kiter312, viter313 in self.confidences.items(): oprot.writeString(kiter312.encode('utf-8') if sys.version_info[0] == 2 else kiter312) oprot.writeDouble(viter313) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BrandClassifyResult(object): """ Attributes: - confidences """ def __init__(self, confidences=None,): self.confidences = confidences def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.confidences = {} (_ktype315, _vtype316, _size314) = iprot.readMapBegin() for _i318 in range(_size314): _key319 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val320 = iprot.readDouble() self.confidences[_key319] = _val320 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BrandClassifyResult') if self.confidences is not None: oprot.writeFieldBegin('confidences', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.confidences)) for kiter321, viter322 in self.confidences.items(): oprot.writeString(kiter321.encode('utf-8') if sys.version_info[0] == 2 else kiter321) oprot.writeDouble(viter322) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SearchDetectionResult(object): """ Attributes: - boxes - imgUrl - version """ def __init__(self, boxes=None, imgUrl=None, version=None,): self.boxes = boxes self.imgUrl = imgUrl self.version = version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.boxes = [] (_etype326, _size323) = iprot.readListBegin() for _i327 in range(_size323): _elem328 = [] (_etype332, _size329) = iprot.readListBegin() for _i333 in range(_size329): _elem334 = iprot.readDouble() _elem328.append(_elem334) iprot.readListEnd() self.boxes.append(_elem328) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SearchDetectionResult') if self.boxes is not None: oprot.writeFieldBegin('boxes', TType.LIST, 1) oprot.writeListBegin(TType.LIST, len(self.boxes)) for iter335 in self.boxes: oprot.writeListBegin(TType.DOUBLE, len(iter335)) for iter336 in iter335: oprot.writeDouble(iter336) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.STRING, 3) oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SearchEmbeddingResult(object): """ Attributes: - embedding - version """ def __init__(self, embedding=None, version=None,): self.embedding = embedding self.version = version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.embedding = [] (_etype340, _size337) = iprot.readListBegin() for _i341 in range(_size337): _elem342 = iprot.readDouble() self.embedding.append(_elem342) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SearchEmbeddingResult') if self.embedding is not None: oprot.writeFieldBegin('embedding', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.embedding)) for iter343 in self.embedding: oprot.writeDouble(iter343) oprot.writeListEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.STRING, 2) oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SearchClassificationResult(object): """ Attributes: - classification_category_lv1 - classification_category_lv2 - attributes - gender - version """ def __init__(self, classification_category_lv1=None, classification_category_lv2=None, attributes=None, gender=None, version=None,): self.classification_category_lv1 = classification_category_lv1 self.classification_category_lv2 = classification_category_lv2 self.attributes = attributes self.gender = gender self.version = version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.classification_category_lv1 = {} (_ktype345, _vtype346, _size344) = iprot.readMapBegin() for _i348 in range(_size344): _key349 = iprot.readI32() _val350 = iprot.readDouble() self.classification_category_lv1[_key349] = _val350 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.MAP: self.classification_category_lv2 = {} (_ktype352, _vtype353, _size351) = iprot.readMapBegin() for _i355 in range(_size351): _key356 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val357 = iprot.readDouble() self.classification_category_lv2[_key356] = _val357 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.attributes = {} (_ktype359, _vtype360, _size358) = iprot.readMapBegin() for _i362 in range(_size358): _key363 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val364 = iprot.readDouble() self.attributes[_key363] = _val364 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.gender = {} (_ktype366, _vtype367, _size365) = iprot.readMapBegin() for _i369 in range(_size365): _key370 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val371 = iprot.readDouble() self.gender[_key370] = _val371 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SearchClassificationResult') if self.classification_category_lv1 is not None: oprot.writeFieldBegin('classification_category_lv1', TType.MAP, 1) oprot.writeMapBegin(TType.I32, TType.DOUBLE, len(self.classification_category_lv1)) for kiter372, viter373 in self.classification_category_lv1.items(): oprot.writeI32(kiter372) oprot.writeDouble(viter373) oprot.writeMapEnd() oprot.writeFieldEnd() if self.classification_category_lv2 is not None: oprot.writeFieldBegin('classification_category_lv2', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.classification_category_lv2)) for kiter374, viter375 in self.classification_category_lv2.items(): oprot.writeString(kiter374.encode('utf-8') if sys.version_info[0] == 2 else kiter374) oprot.writeDouble(viter375) oprot.writeMapEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.attributes)) for kiter376, viter377 in self.attributes.items(): oprot.writeString(kiter376.encode('utf-8') if sys.version_info[0] == 2 else kiter376) oprot.writeDouble(viter377) oprot.writeMapEnd() oprot.writeFieldEnd() if self.gender is not None: oprot.writeFieldBegin('gender', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.gender)) for kiter378, viter379 in self.gender.items(): oprot.writeString(kiter378.encode('utf-8') if sys.version_info[0] == 2 else kiter378) oprot.writeDouble(viter379) oprot.writeMapEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.STRING, 5) oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SearchBoxInfoResult(object): """ Attributes: - box - embedding - version - classification_category_lv1 - classification_category_lv2 - attributes """ def __init__(self, box=None, embedding=None, version=None, classification_category_lv1=None, classification_category_lv2=None, attributes=None,): self.box = box self.embedding = embedding self.version = version self.classification_category_lv1 = classification_category_lv1 self.classification_category_lv2 = classification_category_lv2 self.attributes = attributes def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.box = [] (_etype383, _size380) = iprot.readListBegin() for _i384 in range(_size380): _elem385 = iprot.readDouble() self.box.append(_elem385) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.embedding = [] (_etype389, _size386) = iprot.readListBegin() for _i390 in range(_size386): _elem391 = iprot.readDouble() self.embedding.append(_elem391) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.version = [] (_etype395, _size392) = iprot.readListBegin() for _i396 in range(_size392): _elem397 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.version.append(_elem397) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.classification_category_lv1 = {} (_ktype399, _vtype400, _size398) = iprot.readMapBegin() for _i402 in range(_size398): _key403 = iprot.readI32() _val404 = iprot.readDouble() self.classification_category_lv1[_key403] = _val404 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.classification_category_lv2 = {} (_ktype406, _vtype407, _size405) = iprot.readMapBegin() for _i409 in range(_size405): _key410 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val411 = iprot.readDouble() self.classification_category_lv2[_key410] = _val411 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.MAP: self.attributes = {} (_ktype413, _vtype414, _size412) = iprot.readMapBegin() for _i416 in range(_size412): _key417 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val418 = iprot.readDouble() self.attributes[_key417] = _val418 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SearchBoxInfoResult') if self.box is not None: oprot.writeFieldBegin('box', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.box)) for iter419 in self.box: oprot.writeDouble(iter419) oprot.writeListEnd() oprot.writeFieldEnd() if self.embedding is not None: oprot.writeFieldBegin('embedding', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.embedding)) for iter420 in self.embedding: oprot.writeDouble(iter420) oprot.writeListEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.version)) for iter421 in self.version: oprot.writeString(iter421.encode('utf-8') if sys.version_info[0] == 2 else iter421) oprot.writeListEnd() oprot.writeFieldEnd() if self.classification_category_lv1 is not None: oprot.writeFieldBegin('classification_category_lv1', TType.MAP, 4) oprot.writeMapBegin(TType.I32, TType.DOUBLE, len(self.classification_category_lv1)) for kiter422, viter423 in self.classification_category_lv1.items(): oprot.writeI32(kiter422) oprot.writeDouble(viter423) oprot.writeMapEnd() oprot.writeFieldEnd() if self.classification_category_lv2 is not None: oprot.writeFieldBegin('classification_category_lv2', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.classification_category_lv2)) for kiter424, viter425 in self.classification_category_lv2.items(): oprot.writeString(kiter424.encode('utf-8') if sys.version_info[0] == 2 else kiter424) oprot.writeDouble(viter425) oprot.writeMapEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 6) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.attributes)) for kiter426, viter427 in self.attributes.items(): oprot.writeString(kiter426.encode('utf-8') if sys.version_info[0] == 2 else kiter426) oprot.writeDouble(viter427) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SearchBoxInfoResultRedCloud(object): """ Attributes: - detCat - embedding - version - x1 - y1 - x2 - y2 """ def __init__(self, detCat=None, embedding=None, version=None, x1=None, y1=None, x2=None, y2=None,): self.detCat = detCat self.embedding = embedding self.version = version self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.detCat = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.embedding = [] (_etype431, _size428) = iprot.readListBegin() for _i432 in range(_size428): _elem433 = iprot.readDouble() self.embedding.append(_elem433) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.version = [] (_etype437, _size434) = iprot.readListBegin() for _i438 in range(_size434): _elem439 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.version.append(_elem439) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.x1 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.DOUBLE: self.y1 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.x2 = iprot.readDouble() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.DOUBLE: self.y2 = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('SearchBoxInfoResultRedCloud') if self.detCat is not None: oprot.writeFieldBegin('detCat', TType.STRING, 1) oprot.writeString(self.detCat.encode('utf-8') if sys.version_info[0] == 2 else self.detCat) oprot.writeFieldEnd() if self.embedding is not None: oprot.writeFieldBegin('embedding', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.embedding)) for iter440 in self.embedding: oprot.writeDouble(iter440) oprot.writeListEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.version)) for iter441 in self.version: oprot.writeString(iter441.encode('utf-8') if sys.version_info[0] == 2 else iter441) oprot.writeListEnd() oprot.writeFieldEnd() if self.x1 is not None: oprot.writeFieldBegin('x1', TType.DOUBLE, 4) oprot.writeDouble(self.x1) oprot.writeFieldEnd() if self.y1 is not None: oprot.writeFieldBegin('y1', TType.DOUBLE, 5) oprot.writeDouble(self.y1) oprot.writeFieldEnd() if self.x2 is not None: oprot.writeFieldBegin('x2', TType.DOUBLE, 6) oprot.writeDouble(self.x2) oprot.writeFieldEnd() if self.y2 is not None: oprot.writeFieldBegin('y2', TType.DOUBLE, 7) oprot.writeDouble(self.y2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TimeSensitiveRequest(object): """ Attributes: - title - content """ def __init__(self, title=None, content=None,): self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TimeSensitiveRequest') if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 1) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 2) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NEREntity(object): """ Attributes: - type - text - startPosition - endPosition - score """ def __init__(self, type=None, text=None, startPosition=None, endPosition=None, score=None,): self.type = type self.text = text self.startPosition = startPosition self.endPosition = endPosition self.score = score def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.startPosition = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.endPosition = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NEREntity') if self.type is not None: oprot.writeFieldBegin('type', TType.STRING, 1) oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.startPosition is not None: oprot.writeFieldBegin('startPosition', TType.I32, 3) oprot.writeI32(self.startPosition) oprot.writeFieldEnd() if self.endPosition is not None: oprot.writeFieldBegin('endPosition', TType.I32, 4) oprot.writeI32(self.endPosition) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 5) oprot.writeDouble(self.score) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NewNEREntity(object): """ Attributes: - type - secondaryType - text - startPosition - endPosition - score """ def __init__(self, type=None, secondaryType=None, text=None, startPosition=None, endPosition=None, score=None,): self.type = type self.secondaryType = secondaryType self.text = text self.startPosition = startPosition self.endPosition = endPosition self.score = score def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.secondaryType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.startPosition = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.endPosition = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NewNEREntity') if self.type is not None: oprot.writeFieldBegin('type', TType.STRING, 1) oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type) oprot.writeFieldEnd() if self.secondaryType is not None: oprot.writeFieldBegin('secondaryType', TType.STRING, 2) oprot.writeString(self.secondaryType.encode('utf-8') if sys.version_info[0] == 2 else self.secondaryType) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 3) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.startPosition is not None: oprot.writeFieldBegin('startPosition', TType.I32, 4) oprot.writeI32(self.startPosition) oprot.writeFieldEnd() if self.endPosition is not None: oprot.writeFieldBegin('endPosition', TType.I32, 5) oprot.writeI32(self.endPosition) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 6) oprot.writeDouble(self.score) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NERResult(object): """ Attributes: - text - textPredict - entities """ def __init__(self, text=None, textPredict=None, entities=None,): self.text = text self.textPredict = textPredict self.entities = entities def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.textPredict = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.entities = [] (_etype445, _size442) = iprot.readListBegin() for _i446 in range(_size442): _elem447 = NEREntity() _elem447.read(iprot) self.entities.append(_elem447) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NERResult') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.textPredict is not None: oprot.writeFieldBegin('textPredict', TType.STRING, 2) oprot.writeString(self.textPredict.encode('utf-8') if sys.version_info[0] == 2 else self.textPredict) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.entities)) for iter448 in self.entities: iter448.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NewNERResult(object): """ Attributes: - text - textPredict - entities """ def __init__(self, text=None, textPredict=None, entities=None,): self.text = text self.textPredict = textPredict self.entities = entities def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.textPredict = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.entities = [] (_etype452, _size449) = iprot.readListBegin() for _i453 in range(_size449): _elem454 = NewNEREntity() _elem454.read(iprot) self.entities.append(_elem454) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NewNERResult') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.textPredict is not None: oprot.writeFieldBegin('textPredict', TType.STRING, 2) oprot.writeString(self.textPredict.encode('utf-8') if sys.version_info[0] == 2 else self.textPredict) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.entities)) for iter455 in self.entities: iter455.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteStructureResult(object): """ Attributes: - key - value - score - domain - freq """ def __init__(self, key=None, value=None, score=None, domain=None, freq=None,): self.key = key self.value = value self.score = score self.domain = domain self.freq = freq def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.domain = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.freq = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteStructureResult') if self.key is not None: oprot.writeFieldBegin('key', TType.STRING, 1) oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key) oprot.writeFieldEnd() if self.value is not None: oprot.writeFieldBegin('value', TType.STRING, 2) oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.domain is not None: oprot.writeFieldBegin('domain', TType.STRING, 4) oprot.writeString(self.domain.encode('utf-8') if sys.version_info[0] == 2 else self.domain) oprot.writeFieldEnd() if self.freq is not None: oprot.writeFieldBegin('freq', TType.I32, 5) oprot.writeI32(self.freq) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class LinkedEntity(object): """ Attributes: - entityId - confidence """ def __init__(self, entityId=None, confidence=None,): self.entityId = entityId self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.entityId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LinkedEntity') if self.entityId is not None: oprot.writeFieldBegin('entityId', TType.STRING, 1) oprot.writeString(self.entityId.encode('utf-8') if sys.version_info[0] == 2 else self.entityId) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EntityLinkResult(object): """ Attributes: - linkedEntities """ def __init__(self, linkedEntities=None,): self.linkedEntities = linkedEntities def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.linkedEntities = [] (_etype459, _size456) = iprot.readListBegin() for _i460 in range(_size456): _elem461 = LinkedEntity() _elem461.read(iprot) self.linkedEntities.append(_elem461) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EntityLinkResult') if self.linkedEntities is not None: oprot.writeFieldBegin('linkedEntities', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.linkedEntities)) for iter462 in self.linkedEntities: iter462.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteStructureRequest(object): """ Attributes: - cate - text """ def __init__(self, cate=None, text=None,): self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteStructureRequest') if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 1) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class GeneralNerResult(object): """ Attributes: - text - textPredict - noteEntities - standardEntities - version """ def __init__(self, text=None, textPredict=None, noteEntities=None, standardEntities=None, version=None,): self.text = text self.textPredict = textPredict self.noteEntities = noteEntities self.standardEntities = standardEntities self.version = version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.textPredict = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.noteEntities = [] (_etype466, _size463) = iprot.readListBegin() for _i467 in range(_size463): _elem468 = NoteStructureResult() _elem468.read(iprot) self.noteEntities.append(_elem468) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.standardEntities = [] (_etype472, _size469) = iprot.readListBegin() for _i473 in range(_size469): _elem474 = NEREntity() _elem474.read(iprot) self.standardEntities.append(_elem474) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('GeneralNerResult') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.textPredict is not None: oprot.writeFieldBegin('textPredict', TType.STRING, 2) oprot.writeString(self.textPredict.encode('utf-8') if sys.version_info[0] == 2 else self.textPredict) oprot.writeFieldEnd() if self.noteEntities is not None: oprot.writeFieldBegin('noteEntities', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.noteEntities)) for iter475 in self.noteEntities: iter475.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.standardEntities is not None: oprot.writeFieldBegin('standardEntities', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.standardEntities)) for iter476 in self.standardEntities: iter476.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.STRING, 5) oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryNerResult(object): """ Attributes: - NERResults """ def __init__(self, NERResults=None,): self.NERResults = NERResults def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.NERResults = [] (_etype480, _size477) = iprot.readListBegin() for _i481 in range(_size477): _elem482 = NERResult() _elem482.read(iprot) self.NERResults.append(_elem482) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryNerResult') if self.NERResults is not None: oprot.writeFieldBegin('NERResults', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.NERResults)) for iter483 in self.NERResults: iter483.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NewQueryNerResult(object): """ Attributes: - NERResults """ def __init__(self, NERResults=None,): self.NERResults = NERResults def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.NERResults = [] (_etype487, _size484) = iprot.readListBegin() for _i488 in range(_size484): _elem489 = NewNERResult() _elem489.read(iprot) self.NERResults.append(_elem489) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NewQueryNerResult') if self.NERResults is not None: oprot.writeFieldBegin('NERResults', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.NERResults)) for iter490 in self.NERResults: iter490.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteFeedbackResult(object): """ Attributes: - categoryId - categoryName """ def __init__(self, categoryId=None, categoryName=None,): self.categoryId = categoryId self.categoryName = categoryName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.categoryId = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.categoryName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteFeedbackResult') if self.categoryId is not None: oprot.writeFieldBegin('categoryId', TType.I32, 1) oprot.writeI32(self.categoryId) oprot.writeFieldEnd() if self.categoryName is not None: oprot.writeFieldBegin('categoryName', TType.STRING, 2) oprot.writeString(self.categoryName.encode('utf-8') if sys.version_info[0] == 2 else self.categoryName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ImportanceResult(object): """ Attributes: - key - value - importance """ def __init__(self, key=None, value=None, importance=None,): self.key = key self.value = value self.importance = importance def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.importance = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ImportanceResult') if self.key is not None: oprot.writeFieldBegin('key', TType.STRING, 1) oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key) oprot.writeFieldEnd() if self.value is not None: oprot.writeFieldBegin('value', TType.STRING, 2) oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value) oprot.writeFieldEnd() if self.importance is not None: oprot.writeFieldBegin('importance', TType.I32, 3) oprot.writeI32(self.importance) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ImportanceScoreResult(object): """ Attributes: - ImpResults """ def __init__(self, ImpResults=None,): self.ImpResults = ImpResults def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.ImpResults = [] (_etype494, _size491) = iprot.readListBegin() for _i495 in range(_size491): _elem496 = ImportanceResult() _elem496.read(iprot) self.ImpResults.append(_elem496) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ImportanceScoreResult') if self.ImpResults is not None: oprot.writeFieldBegin('ImpResults', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.ImpResults)) for iter497 in self.ImpResults: iter497.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AmazingCoverResult(object): """ Attributes: - keyFramePoints - version """ def __init__(self, keyFramePoints=None, version=None,): self.keyFramePoints = keyFramePoints self.version = version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.keyFramePoints = [] (_etype501, _size498) = iprot.readListBegin() for _i502 in range(_size498): _elem503 = iprot.readDouble() self.keyFramePoints.append(_elem503) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.MAP: self.version = {} (_ktype505, _vtype506, _size504) = iprot.readMapBegin() for _i508 in range(_size504): _key509 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val510 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.version[_key509] = _val510 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AmazingCoverResult') if self.keyFramePoints is not None: oprot.writeFieldBegin('keyFramePoints', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.keyFramePoints)) for iter511 in self.keyFramePoints: oprot.writeDouble(iter511) oprot.writeListEnd() oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.version)) for kiter512, viter513 in self.version.items(): oprot.writeString(kiter512.encode('utf-8') if sys.version_info[0] == 2 else kiter512) oprot.writeString(viter513.encode('utf-8') if sys.version_info[0] == 2 else viter513) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteEmbeddingRequest(object): """ Attributes: - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype517, _size514) = iprot.readListBegin() for _i518 in range(_size514): _elem519 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem519) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype523, _size520) = iprot.readListBegin() for _i524 in range(_size520): _elem525 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem525) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype529, _size526) = iprot.readListBegin() for _i530 in range(_size526): _elem531 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem531) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype535, _size532) = iprot.readListBegin() for _i536 in range(_size532): _elem537 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem537) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.keyFrameList = [] (_etype541, _size538) = iprot.readListBegin() for _i542 in range(_size538): _elem543 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem543) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteEmbeddingRequest') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 2) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter544 in self.topicList: oprot.writeString(iter544.encode('utf-8') if sys.version_info[0] == 2 else iter544) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter545 in self.titleList: oprot.writeString(iter545.encode('utf-8') if sys.version_info[0] == 2 else iter545) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter546 in self.contentList: oprot.writeString(iter546.encode('utf-8') if sys.version_info[0] == 2 else iter546) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter547 in self.imageList: oprot.writeString(iter547.encode('utf-8') if sys.version_info[0] == 2 else iter547) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter548 in self.keyFrameList: oprot.writeString(iter548.encode('utf-8') if sys.version_info[0] == 2 else iter548) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteEmbeddingResult(object): """ Attributes: - noteEmbedding """ def __init__(self, noteEmbedding=None,): self.noteEmbedding = noteEmbedding def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.noteEmbedding = [] (_etype552, _size549) = iprot.readListBegin() for _i553 in range(_size549): _elem554 = iprot.readDouble() self.noteEmbedding.append(_elem554) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteEmbeddingResult') if self.noteEmbedding is not None: oprot.writeFieldBegin('noteEmbedding', TType.LIST, 1) oprot.writeListBegin(TType.DOUBLE, len(self.noteEmbedding)) for iter555 in self.noteEmbedding: oprot.writeDouble(iter555) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteInformationRequest(object): """ Attributes: - noteId - noteType - useCache - duration - topicList - titleList - contentList - imageList - keyFrameList - imageOcrs - videoOcrs - taxonomy1 - taxonomy2 - taxonomy3 - userFeatureJson """ def __init__(self, noteId=None, noteType=None, useCache=None, duration=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, imageOcrs=None, videoOcrs=None, taxonomy1=None, taxonomy2=None, taxonomy3=None, userFeatureJson=None,): self.noteId = noteId self.noteType = noteType self.useCache = useCache self.duration = duration self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.imageOcrs = imageOcrs self.videoOcrs = videoOcrs self.taxonomy1 = taxonomy1 self.taxonomy2 = taxonomy2 self.taxonomy3 = taxonomy3 self.userFeatureJson = userFeatureJson def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.duration = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype559, _size556) = iprot.readListBegin() for _i560 in range(_size556): _elem561 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem561) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype565, _size562) = iprot.readListBegin() for _i566 in range(_size562): _elem567 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem567) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype571, _size568) = iprot.readListBegin() for _i572 in range(_size568): _elem573 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem573) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype577, _size574) = iprot.readListBegin() for _i578 in range(_size574): _elem579 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem579) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype583, _size580) = iprot.readListBegin() for _i584 in range(_size580): _elem585 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem585) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.imageOcrs = [] (_etype589, _size586) = iprot.readListBegin() for _i590 in range(_size586): _elem591 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageOcrs.append(_elem591) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.videoOcrs = [] (_etype595, _size592) = iprot.readListBegin() for _i596 in range(_size592): _elem597 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.videoOcrs.append(_elem597) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.taxonomy1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.taxonomy2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: self.taxonomy3 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.STRING: self.userFeatureJson = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteInformationRequest') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 2) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.duration is not None: oprot.writeFieldBegin('duration', TType.I32, 4) oprot.writeI32(self.duration) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter598 in self.topicList: oprot.writeString(iter598.encode('utf-8') if sys.version_info[0] == 2 else iter598) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter599 in self.titleList: oprot.writeString(iter599.encode('utf-8') if sys.version_info[0] == 2 else iter599) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter600 in self.contentList: oprot.writeString(iter600.encode('utf-8') if sys.version_info[0] == 2 else iter600) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter601 in self.imageList: oprot.writeString(iter601.encode('utf-8') if sys.version_info[0] == 2 else iter601) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter602 in self.keyFrameList: oprot.writeString(iter602.encode('utf-8') if sys.version_info[0] == 2 else iter602) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageOcrs is not None: oprot.writeFieldBegin('imageOcrs', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.imageOcrs)) for iter603 in self.imageOcrs: oprot.writeString(iter603.encode('utf-8') if sys.version_info[0] == 2 else iter603) oprot.writeListEnd() oprot.writeFieldEnd() if self.videoOcrs is not None: oprot.writeFieldBegin('videoOcrs', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.videoOcrs)) for iter604 in self.videoOcrs: oprot.writeString(iter604.encode('utf-8') if sys.version_info[0] == 2 else iter604) oprot.writeListEnd() oprot.writeFieldEnd() if self.taxonomy1 is not None: oprot.writeFieldBegin('taxonomy1', TType.STRING, 12) oprot.writeString(self.taxonomy1.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy1) oprot.writeFieldEnd() if self.taxonomy2 is not None: oprot.writeFieldBegin('taxonomy2', TType.STRING, 13) oprot.writeString(self.taxonomy2.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy2) oprot.writeFieldEnd() if self.taxonomy3 is not None: oprot.writeFieldBegin('taxonomy3', TType.STRING, 14) oprot.writeString(self.taxonomy3.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy3) oprot.writeFieldEnd() if self.userFeatureJson is not None: oprot.writeFieldBegin('userFeatureJson', TType.STRING, 15) oprot.writeString(self.userFeatureJson.encode('utf-8') if sys.version_info[0] == 2 else self.userFeatureJson) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteInformationResult(object): """ Attributes: - mcLabel - mcConfidence - eatLabel - eatConfidence """ def __init__(self, mcLabel=None, mcConfidence=None, eatLabel=None, eatConfidence=None,): self.mcLabel = mcLabel self.mcConfidence = mcConfidence self.eatLabel = eatLabel self.eatConfidence = eatConfidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.mcLabel = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.mcConfidence = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.eatLabel = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.eatConfidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteInformationResult') if self.mcLabel is not None: oprot.writeFieldBegin('mcLabel', TType.STRING, 1) oprot.writeString(self.mcLabel.encode('utf-8') if sys.version_info[0] == 2 else self.mcLabel) oprot.writeFieldEnd() if self.mcConfidence is not None: oprot.writeFieldBegin('mcConfidence', TType.DOUBLE, 2) oprot.writeDouble(self.mcConfidence) oprot.writeFieldEnd() if self.eatLabel is not None: oprot.writeFieldBegin('eatLabel', TType.STRING, 3) oprot.writeString(self.eatLabel.encode('utf-8') if sys.version_info[0] == 2 else self.eatLabel) oprot.writeFieldEnd() if self.eatConfidence is not None: oprot.writeFieldBegin('eatConfidence', TType.DOUBLE, 4) oprot.writeDouble(self.eatConfidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.mcLabel is None: raise TProtocolException(message='Required field mcLabel is unset!') if self.mcConfidence is None: raise TProtocolException(message='Required field mcConfidence is unset!') if self.eatLabel is None: raise TProtocolException(message='Required field eatLabel is unset!') if self.eatConfidence is None: raise TProtocolException(message='Required field eatConfidence is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteTimelinessRequest(object): """ Attributes: - noteId - noteType - duration - createTime - topicList - titleList - contentList - imageList - keyFrameList - imageOcrs - videoOcrs - taxonomy1 - taxonomy2 - taxonomy3 """ def __init__(self, noteId=None, noteType=None, duration=None, createTime=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, imageOcrs=None, videoOcrs=None, taxonomy1=None, taxonomy2=None, taxonomy3=None,): self.noteId = noteId self.noteType = noteType self.duration = duration self.createTime = createTime self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.imageOcrs = imageOcrs self.videoOcrs = videoOcrs self.taxonomy1 = taxonomy1 self.taxonomy2 = taxonomy2 self.taxonomy3 = taxonomy3 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.duration = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.createTime = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype608, _size605) = iprot.readListBegin() for _i609 in range(_size605): _elem610 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem610) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype614, _size611) = iprot.readListBegin() for _i615 in range(_size611): _elem616 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem616) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype620, _size617) = iprot.readListBegin() for _i621 in range(_size617): _elem622 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem622) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype626, _size623) = iprot.readListBegin() for _i627 in range(_size623): _elem628 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem628) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype632, _size629) = iprot.readListBegin() for _i633 in range(_size629): _elem634 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem634) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.imageOcrs = [] (_etype638, _size635) = iprot.readListBegin() for _i639 in range(_size635): _elem640 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageOcrs.append(_elem640) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.videoOcrs = [] (_etype644, _size641) = iprot.readListBegin() for _i645 in range(_size641): _elem646 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.videoOcrs.append(_elem646) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.taxonomy1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.taxonomy2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: self.taxonomy3 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteTimelinessRequest') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 2) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.duration is not None: oprot.writeFieldBegin('duration', TType.I32, 3) oprot.writeI32(self.duration) oprot.writeFieldEnd() if self.createTime is not None: oprot.writeFieldBegin('createTime', TType.STRING, 4) oprot.writeString(self.createTime.encode('utf-8') if sys.version_info[0] == 2 else self.createTime) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter647 in self.topicList: oprot.writeString(iter647.encode('utf-8') if sys.version_info[0] == 2 else iter647) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter648 in self.titleList: oprot.writeString(iter648.encode('utf-8') if sys.version_info[0] == 2 else iter648) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter649 in self.contentList: oprot.writeString(iter649.encode('utf-8') if sys.version_info[0] == 2 else iter649) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter650 in self.imageList: oprot.writeString(iter650.encode('utf-8') if sys.version_info[0] == 2 else iter650) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter651 in self.keyFrameList: oprot.writeString(iter651.encode('utf-8') if sys.version_info[0] == 2 else iter651) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageOcrs is not None: oprot.writeFieldBegin('imageOcrs', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.imageOcrs)) for iter652 in self.imageOcrs: oprot.writeString(iter652.encode('utf-8') if sys.version_info[0] == 2 else iter652) oprot.writeListEnd() oprot.writeFieldEnd() if self.videoOcrs is not None: oprot.writeFieldBegin('videoOcrs', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.videoOcrs)) for iter653 in self.videoOcrs: oprot.writeString(iter653.encode('utf-8') if sys.version_info[0] == 2 else iter653) oprot.writeListEnd() oprot.writeFieldEnd() if self.taxonomy1 is not None: oprot.writeFieldBegin('taxonomy1', TType.STRING, 12) oprot.writeString(self.taxonomy1.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy1) oprot.writeFieldEnd() if self.taxonomy2 is not None: oprot.writeFieldBegin('taxonomy2', TType.STRING, 13) oprot.writeString(self.taxonomy2.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy2) oprot.writeFieldEnd() if self.taxonomy3 is not None: oprot.writeFieldBegin('taxonomy3', TType.STRING, 14) oprot.writeString(self.taxonomy3.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy3) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteTimelinessResult(object): """ Attributes: - timeLineType - expireTime """ def __init__(self, timeLineType=None, expireTime=None,): self.timeLineType = timeLineType self.expireTime = expireTime def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.timeLineType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.expireTime = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteTimelinessResult') if self.timeLineType is not None: oprot.writeFieldBegin('timeLineType', TType.STRING, 1) oprot.writeString(self.timeLineType.encode('utf-8') if sys.version_info[0] == 2 else self.timeLineType) oprot.writeFieldEnd() if self.expireTime is not None: oprot.writeFieldBegin('expireTime', TType.STRING, 2) oprot.writeString(self.expireTime.encode('utf-8') if sys.version_info[0] == 2 else self.expireTime) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.timeLineType is None: raise TProtocolException(message='Required field timeLineType is unset!') if self.expireTime is None: raise TProtocolException(message='Required field expireTime is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryEmbeddingResult(object): """ Attributes: - queryEmbedding """ def __init__(self, queryEmbedding=None,): self.queryEmbedding = queryEmbedding def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.queryEmbedding = {} (_ktype655, _vtype656, _size654) = iprot.readMapBegin() for _i658 in range(_size654): _key659 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val660 = [] (_etype664, _size661) = iprot.readListBegin() for _i665 in range(_size661): _elem666 = iprot.readDouble() _val660.append(_elem666) iprot.readListEnd() self.queryEmbedding[_key659] = _val660 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryEmbeddingResult') if self.queryEmbedding is not None: oprot.writeFieldBegin('queryEmbedding', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.queryEmbedding)) for kiter667, viter668 in self.queryEmbedding.items(): oprot.writeString(kiter667.encode('utf-8') if sys.version_info[0] == 2 else kiter667) oprot.writeListBegin(TType.DOUBLE, len(viter668)) for iter669 in viter668: oprot.writeDouble(iter669) oprot.writeListEnd() oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryEmbeddingRequest(object): """ Attributes: - query """ def __init__(self, query=None,): self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryEmbeddingRequest') if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 1) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryLabelCorrelationRequest(object): """ Attributes: - content - noteId - recQueryList - title - imageList - keyFrameList """ def __init__(self, content=None, noteId=None, recQueryList=None, title=None, imageList=None, keyFrameList=None,): self.content = content self.noteId = noteId self.recQueryList = recQueryList self.title = title self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.recQueryList = [] (_etype673, _size670) = iprot.readListBegin() for _i674 in range(_size670): _elem675 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.recQueryList.append(_elem675) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.imageList = [] (_etype679, _size676) = iprot.readListBegin() for _i680 in range(_size676): _elem681 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem681) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.keyFrameList = [] (_etype685, _size682) = iprot.readListBegin() for _i686 in range(_size682): _elem687 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem687) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryLabelCorrelationRequest') if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 1) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.recQueryList is not None: oprot.writeFieldBegin('recQueryList', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.recQueryList)) for iter688 in self.recQueryList: oprot.writeString(iter688.encode('utf-8') if sys.version_info[0] == 2 else iter688) oprot.writeListEnd() oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 4) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter689 in self.imageList: oprot.writeString(iter689.encode('utf-8') if sys.version_info[0] == 2 else iter689) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter690 in self.keyFrameList: oprot.writeString(iter690.encode('utf-8') if sys.version_info[0] == 2 else iter690) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryLabelCorrelationResult(object): """ Attributes: - PredictQrList """ def __init__(self, PredictQrList=None,): self.PredictQrList = PredictQrList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.PredictQrList = [] (_etype694, _size691) = iprot.readListBegin() for _i695 in range(_size691): _elem696 = QueryLabelCorrelationItem() _elem696.read(iprot) self.PredictQrList.append(_elem696) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryLabelCorrelationResult') if self.PredictQrList is not None: oprot.writeFieldBegin('PredictQrList', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.PredictQrList)) for iter697 in self.PredictQrList: iter697.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryLabelCorrelationItem(object): """ Attributes: - noteId - tag - score """ def __init__(self, noteId=None, tag=None, score=None,): self.noteId = noteId self.tag = tag self.score = score def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryLabelCorrelationItem') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.tag is not None: oprot.writeFieldBegin('tag', TType.STRING, 2) oprot.writeString(self.tag.encode('utf-8') if sys.version_info[0] == 2 else self.tag) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DocGenerateQueryRequest(object): """ Attributes: - noteIdList - titleList - contentList - generateQueryMaxCount """ def __init__(self, noteIdList=None, titleList=None, contentList=None, generateQueryMaxCount=None,): self.noteIdList = noteIdList self.titleList = titleList self.contentList = contentList self.generateQueryMaxCount = generateQueryMaxCount def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.noteIdList = [] (_etype701, _size698) = iprot.readListBegin() for _i702 in range(_size698): _elem703 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.noteIdList.append(_elem703) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.titleList = [] (_etype707, _size704) = iprot.readListBegin() for _i708 in range(_size704): _elem709 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem709) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.contentList = [] (_etype713, _size710) = iprot.readListBegin() for _i714 in range(_size710): _elem715 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem715) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.generateQueryMaxCount = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DocGenerateQueryRequest') if self.noteIdList is not None: oprot.writeFieldBegin('noteIdList', TType.LIST, 1) oprot.writeListBegin(TType.STRING, len(self.noteIdList)) for iter716 in self.noteIdList: oprot.writeString(iter716.encode('utf-8') if sys.version_info[0] == 2 else iter716) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter717 in self.titleList: oprot.writeString(iter717.encode('utf-8') if sys.version_info[0] == 2 else iter717) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter718 in self.contentList: oprot.writeString(iter718.encode('utf-8') if sys.version_info[0] == 2 else iter718) oprot.writeListEnd() oprot.writeFieldEnd() if self.generateQueryMaxCount is not None: oprot.writeFieldBegin('generateQueryMaxCount', TType.I32, 4) oprot.writeI32(self.generateQueryMaxCount) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DocGenerateQueryResult(object): """ Attributes: - docGenerateQueryList """ def __init__(self, docGenerateQueryList=None,): self.docGenerateQueryList = docGenerateQueryList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.docGenerateQueryList = [] (_etype722, _size719) = iprot.readListBegin() for _i723 in range(_size719): _elem724 = DocGenerateQueryItem() _elem724.read(iprot) self.docGenerateQueryList.append(_elem724) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DocGenerateQueryResult') if self.docGenerateQueryList is not None: oprot.writeFieldBegin('docGenerateQueryList', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.docGenerateQueryList)) for iter725 in self.docGenerateQueryList: iter725.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DocGenerateQueryItem(object): """ Attributes: - noteId - queryList """ def __init__(self, noteId=None, queryList=None,): self.noteId = noteId self.queryList = queryList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.queryList = [] (_etype729, _size726) = iprot.readListBegin() for _i730 in range(_size726): _elem731 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.queryList.append(_elem731) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DocGenerateQueryItem') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.queryList is not None: oprot.writeFieldBegin('queryList', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.queryList)) for iter732 in self.queryList: oprot.writeString(iter732.encode('utf-8') if sys.version_info[0] == 2 else iter732) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteIntentRequest(object): """ Attributes: - noteId - title - content """ def __init__(self, noteId=None, title=None, content=None,): self.noteId = noteId self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteIntentRequest') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 2) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteIntentResult(object): """ Attributes: - noteId - intent - confidence """ def __init__(self, noteId=None, intent=None, confidence=None,): self.noteId = noteId self.intent = intent self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.intent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteIntentResult') if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 1) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.intent is not None: oprot.writeFieldBegin('intent', TType.STRING, 2) oprot.writeString(self.intent.encode('utf-8') if sys.version_info[0] == 2 else self.intent) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 3) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryGeneralIntentRequest(object): """ Attributes: - text - feature """ def __init__(self, text=None, feature=None,): self.text = text self.feature = feature def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.feature = [] (_etype736, _size733) = iprot.readListBegin() for _i737 in range(_size733): _elem738 = iprot.readDouble() self.feature.append(_elem738) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryGeneralIntentRequest') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.feature is not None: oprot.writeFieldBegin('feature', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.feature)) for iter739 in self.feature: oprot.writeDouble(iter739) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryGeneralIntentV2Request(object): """ Attributes: - text - nerDetail - feature - nerType - tax1 - tax2 """ def __init__(self, text=None, nerDetail=None, feature=None, nerType=None, tax1=None, tax2=None,): self.text = text self.nerDetail = nerDetail self.feature = feature self.nerType = nerType self.tax1 = tax1 self.tax2 = tax2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.nerDetail = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.feature = [] (_etype743, _size740) = iprot.readListBegin() for _i744 in range(_size740): _elem745 = iprot.readDouble() self.feature.append(_elem745) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.nerType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.tax1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.tax2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryGeneralIntentV2Request') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.nerDetail is not None: oprot.writeFieldBegin('nerDetail', TType.STRING, 2) oprot.writeString(self.nerDetail.encode('utf-8') if sys.version_info[0] == 2 else self.nerDetail) oprot.writeFieldEnd() if self.feature is not None: oprot.writeFieldBegin('feature', TType.LIST, 3) oprot.writeListBegin(TType.DOUBLE, len(self.feature)) for iter746 in self.feature: oprot.writeDouble(iter746) oprot.writeListEnd() oprot.writeFieldEnd() if self.nerType is not None: oprot.writeFieldBegin('nerType', TType.STRING, 4) oprot.writeString(self.nerType.encode('utf-8') if sys.version_info[0] == 2 else self.nerType) oprot.writeFieldEnd() if self.tax1 is not None: oprot.writeFieldBegin('tax1', TType.STRING, 5) oprot.writeString(self.tax1.encode('utf-8') if sys.version_info[0] == 2 else self.tax1) oprot.writeFieldEnd() if self.tax2 is not None: oprot.writeFieldBegin('tax2', TType.STRING, 6) oprot.writeString(self.tax2.encode('utf-8') if sys.version_info[0] == 2 else self.tax2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryQualityV2Request(object): """ Attributes: - text - searchNum - searchNumLabel - pplScore """ def __init__(self, text=None, searchNum=None, searchNumLabel=None, pplScore=None,): self.text = text self.searchNum = searchNum self.searchNumLabel = searchNumLabel self.pplScore = pplScore def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.searchNum = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.searchNumLabel = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.pplScore = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryQualityV2Request') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.searchNum is not None: oprot.writeFieldBegin('searchNum', TType.DOUBLE, 2) oprot.writeDouble(self.searchNum) oprot.writeFieldEnd() if self.searchNumLabel is not None: oprot.writeFieldBegin('searchNumLabel', TType.DOUBLE, 3) oprot.writeDouble(self.searchNumLabel) oprot.writeFieldEnd() if self.pplScore is not None: oprot.writeFieldBegin('pplScore', TType.DOUBLE, 4) oprot.writeDouble(self.pplScore) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryGeneralIntentResult(object): """ Attributes: - intent - confidence """ def __init__(self, intent=None, confidence=None,): self.intent = intent self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.intent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryGeneralIntentResult') if self.intent is not None: oprot.writeFieldBegin('intent', TType.STRING, 1) oprot.writeString(self.intent.encode('utf-8') if sys.version_info[0] == 2 else self.intent) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 2) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryCorrectionResult(object): """ Attributes: - correct - confidence """ def __init__(self, correct=None, confidence=None,): self.correct = correct self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.correct = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.confidence = [] (_etype750, _size747) = iprot.readListBegin() for _i751 in range(_size747): _elem752 = iprot.readDouble() self.confidence.append(_elem752) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryCorrectionResult') if self.correct is not None: oprot.writeFieldBegin('correct', TType.STRING, 1) oprot.writeString(self.correct.encode('utf-8') if sys.version_info[0] == 2 else self.correct) oprot.writeFieldEnd() if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.confidence)) for iter753 in self.confidence: oprot.writeDouble(iter753) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QualityKenLMResult(object): """ Attributes: - score """ def __init__(self, score=None,): self.score = score def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QualityKenLMResult') if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 1) oprot.writeDouble(self.score) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QueryQualityV2Result(object): """ Attributes: - score """ def __init__(self, score=None,): self.score = score def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QueryQualityV2Result') if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 1) oprot.writeDouble(self.score) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BaikeEntityLinkFeat(object): """ Attributes: - entityId - disambiguationText - summary - basicInfo - popularity - recallScore - anchorTexts - entityType1 - entityType2 - name """ def __init__(self, entityId=None, disambiguationText=None, summary=None, basicInfo=None, popularity=None, recallScore=None, anchorTexts=None, entityType1=None, entityType2=None, name=None,): self.entityId = entityId self.disambiguationText = disambiguationText self.summary = summary self.basicInfo = basicInfo self.popularity = popularity self.recallScore = recallScore self.anchorTexts = anchorTexts self.entityType1 = entityType1 self.entityType2 = entityType2 self.name = name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.entityId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.disambiguationText = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.summary = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.basicInfo = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.popularity = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.recallScore = iprot.readDouble() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.anchorTexts = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.entityType1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.entityType2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BaikeEntityLinkFeat') if self.entityId is not None: oprot.writeFieldBegin('entityId', TType.STRING, 1) oprot.writeString(self.entityId.encode('utf-8') if sys.version_info[0] == 2 else self.entityId) oprot.writeFieldEnd() if self.disambiguationText is not None: oprot.writeFieldBegin('disambiguationText', TType.STRING, 2) oprot.writeString(self.disambiguationText.encode('utf-8') if sys.version_info[0] == 2 else self.disambiguationText) oprot.writeFieldEnd() if self.summary is not None: oprot.writeFieldBegin('summary', TType.STRING, 3) oprot.writeString(self.summary.encode('utf-8') if sys.version_info[0] == 2 else self.summary) oprot.writeFieldEnd() if self.basicInfo is not None: oprot.writeFieldBegin('basicInfo', TType.STRING, 4) oprot.writeString(self.basicInfo.encode('utf-8') if sys.version_info[0] == 2 else self.basicInfo) oprot.writeFieldEnd() if self.popularity is not None: oprot.writeFieldBegin('popularity', TType.I32, 5) oprot.writeI32(self.popularity) oprot.writeFieldEnd() if self.recallScore is not None: oprot.writeFieldBegin('recallScore', TType.DOUBLE, 6) oprot.writeDouble(self.recallScore) oprot.writeFieldEnd() if self.anchorTexts is not None: oprot.writeFieldBegin('anchorTexts', TType.STRING, 7) oprot.writeString(self.anchorTexts.encode('utf-8') if sys.version_info[0] == 2 else self.anchorTexts) oprot.writeFieldEnd() if self.entityType1 is not None: oprot.writeFieldBegin('entityType1', TType.STRING, 8) oprot.writeString(self.entityType1.encode('utf-8') if sys.version_info[0] == 2 else self.entityType1) oprot.writeFieldEnd() if self.entityType2 is not None: oprot.writeFieldBegin('entityType2', TType.STRING, 9) oprot.writeString(self.entityType2.encode('utf-8') if sys.version_info[0] == 2 else self.entityType2) oprot.writeFieldEnd() if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 10) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class poiLinkRankFeat(object): """ Attributes: - entityId - name - address - type - popularity - recallScore """ def __init__(self, entityId=None, name=None, address=None, type=None, popularity=None, recallScore=None,): self.entityId = entityId self.name = name self.address = address self.type = type self.popularity = popularity self.recallScore = recallScore def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.entityId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.address = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.popularity = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.DOUBLE: self.recallScore = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('poiLinkRankFeat') if self.entityId is not None: oprot.writeFieldBegin('entityId', TType.STRING, 1) oprot.writeString(self.entityId.encode('utf-8') if sys.version_info[0] == 2 else self.entityId) oprot.writeFieldEnd() if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 2) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.address is not None: oprot.writeFieldBegin('address', TType.STRING, 3) oprot.writeString(self.address.encode('utf-8') if sys.version_info[0] == 2 else self.address) oprot.writeFieldEnd() if self.type is not None: oprot.writeFieldBegin('type', TType.STRING, 4) oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type) oprot.writeFieldEnd() if self.popularity is not None: oprot.writeFieldBegin('popularity', TType.I32, 5) oprot.writeI32(self.popularity) oprot.writeFieldEnd() if self.recallScore is not None: oprot.writeFieldBegin('recallScore', TType.DOUBLE, 6) oprot.writeDouble(self.recallScore) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QuerySynonymRequest(object): """ Attributes: - query1 - query2 """ def __init__(self, query1=None, query2=None,): self.query1 = query1 self.query2 = query2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.query1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QuerySynonymRequest') if self.query1 is not None: oprot.writeFieldBegin('query1', TType.STRING, 1) oprot.writeString(self.query1.encode('utf-8') if sys.version_info[0] == 2 else self.query1) oprot.writeFieldEnd() if self.query2 is not None: oprot.writeFieldBegin('query2', TType.STRING, 2) oprot.writeString(self.query2.encode('utf-8') if sys.version_info[0] == 2 else self.query2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class QuerySynonymResult(object): """ Attributes: - confidence """ def __init__(self, confidence=None,): self.confidence = confidence def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.confidence = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('QuerySynonymResult') if self.confidence is not None: oprot.writeFieldBegin('confidence', TType.DOUBLE, 1) oprot.writeDouble(self.confidence) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteCategoryLinkCandidate(object): """ Attributes: - categoryId - categoryName """ def __init__(self, categoryId=None, categoryName=None,): self.categoryId = categoryId self.categoryName = categoryName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.categoryId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.categoryName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteCategoryLinkCandidate') if self.categoryId is not None: oprot.writeFieldBegin('categoryId', TType.STRING, 1) oprot.writeString(self.categoryId.encode('utf-8') if sys.version_info[0] == 2 else self.categoryId) oprot.writeFieldEnd() if self.categoryName is not None: oprot.writeFieldBegin('categoryName', TType.STRING, 2) oprot.writeString(self.categoryName.encode('utf-8') if sys.version_info[0] == 2 else self.categoryName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class GoodsSpuLinkCandidate(object): """ Attributes: - spuId - spuName """ def __init__(self, spuId=None, spuName=None,): self.spuId = spuId self.spuName = spuName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.spuId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.spuName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('GoodsSpuLinkCandidate') if self.spuId is not None: oprot.writeFieldBegin('spuId', TType.STRING, 1) oprot.writeString(self.spuId.encode('utf-8') if sys.version_info[0] == 2 else self.spuId) oprot.writeFieldEnd() if self.spuName is not None: oprot.writeFieldBegin('spuName', TType.STRING, 2) oprot.writeString(self.spuName.encode('utf-8') if sys.version_info[0] == 2 else self.spuName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteCategoryLinkResult(object): """ Attributes: - thirdEntityId - thirdConfidence - thirdEntityName - fourthEntityId - fourthConfidence - fourthEntityName """ def __init__(self, thirdEntityId=None, thirdConfidence=None, thirdEntityName=None, fourthEntityId=None, fourthConfidence=None, fourthEntityName=None,): self.thirdEntityId = thirdEntityId self.thirdConfidence = thirdConfidence self.thirdEntityName = thirdEntityName self.fourthEntityId = fourthEntityId self.fourthConfidence = fourthConfidence self.fourthEntityName = fourthEntityName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.thirdEntityId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.thirdConfidence = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.thirdEntityName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.fourthEntityId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.DOUBLE: self.fourthConfidence = iprot.readDouble() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.fourthEntityName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NoteCategoryLinkResult') if self.thirdEntityId is not None: oprot.writeFieldBegin('thirdEntityId', TType.STRING, 1) oprot.writeString(self.thirdEntityId.encode('utf-8') if sys.version_info[0] == 2 else self.thirdEntityId) oprot.writeFieldEnd() if self.thirdConfidence is not None: oprot.writeFieldBegin('thirdConfidence', TType.DOUBLE, 2) oprot.writeDouble(self.thirdConfidence) oprot.writeFieldEnd() if self.thirdEntityName is not None: oprot.writeFieldBegin('thirdEntityName', TType.STRING, 3) oprot.writeString(self.thirdEntityName.encode('utf-8') if sys.version_info[0] == 2 else self.thirdEntityName) oprot.writeFieldEnd() if self.fourthEntityId is not None: oprot.writeFieldBegin('fourthEntityId', TType.STRING, 4) oprot.writeString(self.fourthEntityId.encode('utf-8') if sys.version_info[0] == 2 else self.fourthEntityId) oprot.writeFieldEnd() if self.fourthConfidence is not None: oprot.writeFieldBegin('fourthConfidence', TType.DOUBLE, 5) oprot.writeDouble(self.fourthConfidence) oprot.writeFieldEnd() if self.fourthEntityName is not None: oprot.writeFieldBegin('fourthEntityName', TType.STRING, 6) oprot.writeString(self.fourthEntityName.encode('utf-8') if sys.version_info[0] == 2 else self.fourthEntityName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CaesarCommonRequest(object): """ Attributes: - blsName - jsonStringRequest """ def __init__(self, blsName=None, jsonStringRequest=None,): self.blsName = blsName self.jsonStringRequest = jsonStringRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.blsName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.jsonStringRequest = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CaesarCommonRequest') if self.blsName is not None: oprot.writeFieldBegin('blsName', TType.STRING, 1) oprot.writeString(self.blsName.encode('utf-8') if sys.version_info[0] == 2 else self.blsName) oprot.writeFieldEnd() if self.jsonStringRequest is not None: oprot.writeFieldBegin('jsonStringRequest', TType.STRING, 2) oprot.writeString(self.jsonStringRequest.encode('utf-8') if sys.version_info[0] == 2 else self.jsonStringRequest) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.blsName is None: raise TProtocolException(message='Required field blsName is unset!') if self.jsonStringRequest is None: raise TProtocolException(message='Required field jsonStringRequest is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class CaesarCommonResponse(object): """ Attributes: - result - jsonStringResult """ def __init__(self, result=None, jsonStringResult=None,): self.result = result self.jsonStringResult = jsonStringResult def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.result = Result() self.result.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.jsonStringResult = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('CaesarCommonResponse') if self.result is not None: oprot.writeFieldBegin('result', TType.STRUCT, 1) self.result.write(oprot) oprot.writeFieldEnd() if self.jsonStringResult is not None: oprot.writeFieldBegin('jsonStringResult', TType.STRING, 2) oprot.writeString(self.jsonStringResult.encode('utf-8') if sys.version_info[0] == 2 else self.jsonStringResult) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Result) Result.thrift_spec = ( None, # 0 (1, TType.BOOL, 'success', None, None, ), # 1 (2, TType.I32, 'code', None, None, ), # 2 (3, TType.STRING, 'message', 'UTF8', None, ), # 3 ) all_structs.append(ClassifyAlgoResult) ClassifyAlgoResult.thrift_spec = ( None, # 0 (1, TType.I32, 'propValueId', None, None, ), # 1 (2, TType.STRING, 'propValueName', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(CommentRequest) CommentRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.BOOL, 'sameAuthor', None, None, ), # 2 (3, TType.STRING, 'contextText', 'UTF8', None, ), # 3 (4, TType.BOOL, 'brandAuthor', None, None, ), # 4 (5, TType.STRING, 'noteContentText', 'UTF8', None, ), # 5 (6, TType.LIST, 'noteImgEmbed', (TType.DOUBLE, None, False), None, ), # 6 (7, TType.LIST, 'historyContentText', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.STRING, 'noteId', 'UTF8', None, ), # 8 (9, TType.STRING, 'noteType', 'UTF8', None, ), # 9 (10, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 10 (11, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 11 (12, TType.STRING, 'userFeatureJson', 'UTF8', None, ), # 12 (13, TType.STRING, 'FeatureJson', 'UTF8', None, ), # 13 ) all_structs.append(CommentResult) CommentResult.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'unkind', None, None, ), # 1 (2, TType.DOUBLE, 'low', None, None, ), # 2 (3, TType.DOUBLE, 'political', None, None, ), # 3 (4, TType.DOUBLE, 'insult', None, None, ), # 4 (5, TType.DOUBLE, 'ads_v2', None, None, ), # 5 (6, TType.DOUBLE, 'ads_v3', None, None, ), # 6 (7, TType.DOUBLE, 'unkind_v2', None, None, ), # 7 (8, TType.DOUBLE, 'insult_v2', None, None, ), # 8 (9, TType.DOUBLE, 'low_v2', None, None, ), # 9 (10, TType.DOUBLE, 'meaning', None, None, ), # 10 (11, TType.DOUBLE, 'ads', None, None, ), # 11 (12, TType.DOUBLE, 'unkind_v3', None, None, ), # 12 (13, TType.DOUBLE, 'illegal', None, None, ), # 13 (14, TType.DOUBLE, 'meaning_v2', None, None, ), # 14 (15, TType.DOUBLE, 'political_v2', None, None, ), # 15 (16, TType.DOUBLE, 'political_v3', None, None, ), # 16 (17, TType.DOUBLE, 'meaning_v3', None, None, ), # 17 (18, TType.DOUBLE, 'low_v3', None, None, ), # 18 (19, TType.DOUBLE, 'ads_v4', None, None, ), # 19 (20, TType.DOUBLE, 'unkind_v4', None, None, ), # 20 (21, TType.DOUBLE, 'low_v4', None, None, ), # 21 (22, TType.DOUBLE, 'insult_v3', None, None, ), # 22 (23, TType.DOUBLE, 'ad_in', None, None, ), # 23 (24, TType.DOUBLE, 'porn', None, None, ), # 24 (25, TType.DOUBLE, 'harass', None, None, ), # 25 (26, TType.DOUBLE, 'comment_order', None, None, ), # 26 (27, TType.DOUBLE, 'unkind_v5', None, None, ), # 27 (28, TType.DOUBLE, 'ads_v5', None, None, ), # 28 (29, TType.DOUBLE, 'unkind_v6', None, None, ), # 29 (30, TType.DOUBLE, 'ads_v6', None, None, ), # 30 (31, TType.DOUBLE, 'comment_order_pos', None, None, ), # 31 (32, TType.DOUBLE, 'unkind_v7', None, None, ), # 32 (33, TType.STRING, 'intent', 'UTF8', None, ), # 33 (34, TType.STRING, 'sentiment', 'UTF8', None, ), # 34 (35, TType.DOUBLE, 'unkind_v8', None, None, ), # 35 (36, TType.DOUBLE, 'unfriendly_v2', None, None, ), # 36 (37, TType.STRING, 'intent_v2', 'UTF8', None, ), # 37 (38, TType.STRING, 'sentiment_v2', 'UTF8', None, ), # 38 (39, TType.STRING, 'emotion', 'UTF8', None, ), # 39 (40, TType.STRING, 'conflict', 'UTF8', None, ), # 40 (41, TType.STRING, 'conflict_topic', 'UTF8', None, ), # 41 (42, TType.DOUBLE, 'comment_like', None, None, ), # 42 (43, TType.DOUBLE, 'comment_reply', None, None, ), # 43 (44, TType.DOUBLE, 'comment_report', None, None, ), # 44 (45, TType.DOUBLE, 'unkind_v9', None, None, ), # 45 ) all_structs.append(DanmuRequest) DanmuRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 ) all_structs.append(DanmuResult) DanmuResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 ) all_structs.append(TaxonomyResult) TaxonomyResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'lv1_top1_taxonomy', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'lv1_top1_score', None, None, ), # 2 (3, TType.STRING, 'lv1_top2_taxonomy', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'lv1_top2_score', None, None, ), # 4 (5, TType.STRING, 'lv2_top1_taxonomy', 'UTF8', None, ), # 5 (6, TType.DOUBLE, 'lv2_top1_score', None, None, ), # 6 (7, TType.STRING, 'lv2_top2_taxonomy', 'UTF8', None, ), # 7 (8, TType.DOUBLE, 'lv2_top2_score', None, None, ), # 8 (9, TType.STRING, 'final_top1_taxonomy', 'UTF8', None, ), # 9 (10, TType.STRING, 'final_top2_taxonomy', 'UTF8', None, ), # 10 ) all_structs.append(TaxonomyV2Result) TaxonomyV2Result.thrift_spec = ( None, # 0 (1, TType.STRING, 'lv1_top1_taxonomy', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'lv1_top1_score', None, None, ), # 2 (3, TType.STRING, 'lv1_top2_taxonomy', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'lv1_top2_score', None, None, ), # 4 (5, TType.STRING, 'lv2_top1_taxonomy', 'UTF8', None, ), # 5 (6, TType.DOUBLE, 'lv2_top1_score', None, None, ), # 6 (7, TType.STRING, 'lv2_top2_taxonomy', 'UTF8', None, ), # 7 (8, TType.DOUBLE, 'lv2_top2_score', None, None, ), # 8 (9, TType.STRING, 'lv3_top1_taxonomy', 'UTF8', None, ), # 9 (10, TType.DOUBLE, 'lv3_top1_score', None, None, ), # 10 (11, TType.STRING, 'lv3_top2_taxonomy', 'UTF8', None, ), # 11 (12, TType.DOUBLE, 'lv3_top2_score', None, None, ), # 12 (13, TType.STRING, 'final_top1_taxonomy', 'UTF8', None, ), # 13 (14, TType.STRING, 'final_top2_taxonomy', 'UTF8', None, ), # 14 (15, TType.STRING, 'final_top3_taxonomy', 'UTF8', None, ), # 15 ) all_structs.append(CustomerConversationTurn) CustomerConversationTurn.thrift_spec = ( None, # 0 (1, TType.STRING, 'sender_type', 'UTF8', None, ), # 1 (2, TType.I32, 'content_type', None, None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 ) all_structs.append(AudioResult) AudioResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'musicId', None, None, ), # 2 (3, TType.STRING, 'musicIdNoteId', 'UTF8', None, ), # 3 ) all_structs.append(AiGoTrainConfig) AiGoTrainConfig.thrift_spec = ( None, # 0 (1, TType.STRING, 'modelName', 'UTF8', None, ), # 1 (2, TType.I32, 'epoch', None, None, ), # 2 (3, TType.I32, 'batchSize', None, None, ), # 3 (4, TType.DOUBLE, 'testSplit', None, None, ), # 4 ) all_structs.append(AigoTrainResult) AigoTrainResult.thrift_spec = ( None, # 0 (1, TType.MAP, 'acc', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 1 (2, TType.STRING, 'modelPath', 'UTF8', None, ), # 2 (3, TType.STRING, 'modelVersion', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'accuracy', None, None, ), # 4 ) all_structs.append(AigoMaterial) AigoMaterial.thrift_spec = ( None, # 0 (1, TType.I64, 'materialId', None, None, ), # 1 (2, TType.STRING, 'outerId', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 ) all_structs.append(AigoTestResult) AigoTestResult.thrift_spec = ( None, # 0 (1, TType.I64, 'materialId', None, None, ), # 1 (2, TType.STRING, 'label', 'UTF8', None, ), # 2 (3, TType.STRING, 'result', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'confidence', None, None, ), # 4 ) all_structs.append(KnowledgeResult) KnowledgeResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 ) all_structs.append(NoteSecurityResult) NoteSecurityResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.STRING, 'category', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(GiftBoxResult) GiftBoxResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.STRING, 'category', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(AdvertiseResult) AdvertiseResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.STRING, 'category', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(FashionResult) FashionResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.STRING, 'category', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(FeedbackResult) FeedbackResult.thrift_spec = ( None, # 0 (1, TType.I32, 'categoryId', None, None, ), # 1 (2, TType.STRING, 'categoryName', 'UTF8', None, ), # 2 ) all_structs.append(EntityResult) EntityResult.thrift_spec = ( None, # 0 (1, TType.I32, 'startPos', None, None, ), # 1 (2, TType.I32, 'endPos', None, None, ), # 2 (3, TType.STRING, 'name', 'UTF8', None, ), # 3 ) all_structs.append(FaceResult) FaceResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.LIST, 'bbox', (TType.I32, None, False), None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 (4, TType.DOUBLE, 'area', None, None, ), # 4 ) all_structs.append(FaceRecognition) FaceRecognition.thrift_spec = ( None, # 0 (1, TType.LIST, 'similarity', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.LIST, 'name', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.LIST, 'bbs', (TType.LIST, (TType.I32, None, False), False), None, ), # 3 (4, TType.LIST, 'ccs', (TType.DOUBLE, None, False), None, ), # 4 ) all_structs.append(FaceRecognitionResult) FaceRecognitionResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'bbox', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.LIST, 'kps', (TType.LIST, (TType.DOUBLE, None, False), False), None, ), # 2 (3, TType.DOUBLE, 'detScore', None, None, ), # 3 (4, TType.I32, 'gender', None, None, ), # 4 (5, TType.I32, 'age', None, None, ), # 5 (6, TType.STRING, 'name', 'UTF8', None, ), # 6 (7, TType.DOUBLE, 'similarity', None, None, ), # 7 (8, TType.LIST, 'embedding', (TType.DOUBLE, None, False), None, ), # 8 (9, TType.DOUBLE, 'area', None, None, ), # 9 (10, TType.STRING, 'label', 'UTF8', None, ), # 10 ) all_structs.append(SimilarWord) SimilarWord.thrift_spec = ( None, # 0 (1, TType.STRING, 'word', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'similarity', None, None, ), # 2 ) all_structs.append(ImageClassificationResult) ImageClassificationResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'name', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 ) all_structs.append(AestheticAssessmentResult) AestheticAssessmentResult.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'score', None, None, ), # 1 (2, TType.LIST, 'scores', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(CtrEmbeddingResult) CtrEmbeddingResult.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'ctrScore', None, None, ), # 1 (2, TType.LIST, 'ctrEmbedding', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(CtrRankingResult) CtrRankingResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'orderedUrls', (TType.STRING, 'UTF8', False), None, ), # 1 (2, TType.LIST, 'ctrScores', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(VideoTaggingResult) VideoTaggingResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'labels', (TType.STRING, 'UTF8', False), None, ), # 1 (2, TType.LIST, 'scores', (TType.DOUBLE, None, False), None, ), # 2 (3, TType.LIST, 'ids', (TType.I32, None, False), None, ), # 3 (4, TType.LIST, 'enables', (TType.BOOL, None, False), None, ), # 4 ) all_structs.append(MusicRec) MusicRec.thrift_spec = ( None, # 0 (1, TType.STRING, 'musicId', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'similarity', None, None, ), # 2 ) all_structs.append(UserClassificationRequest) UserClassificationRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'userId', 'UTF8', None, ), # 1 (2, TType.LIST, 'noteIds', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.LIST, 'imgUrls', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 3 (4, TType.LIST, 'keyFrames', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 4 (5, TType.LIST, 'titles', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contents', (TType.STRING, 'UTF8', False), None, ), # 6 ) all_structs.append(AccusationResult) AccusationResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'label', 'UTF8', None, ), # 1 (2, TType.STRING, 'category', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(EcologyRequest) EcologyRequest.thrift_spec = ( None, # 0 (1, TType.LIST, 'imgUrls', (TType.STRING, 'UTF8', False), None, ), # 1 (2, TType.STRING, 'title', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 ) all_structs.append(EcologyResult) EcologyResult.thrift_spec = ( None, # 0 (1, TType.I32, 'propValueId', None, None, ), # 1 (2, TType.STRING, 'propValueName', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 (4, TType.DOUBLE, 'qualityScore', None, None, ), # 4 ) all_structs.append(BboxResult) BboxResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'bbox', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 (3, TType.STRING, 'label', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'area', None, None, ), # 4 ) all_structs.append(TagCorrelationRequest) TagCorrelationRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'noteType', None, None, ), # 2 (3, TType.LIST, 'tags', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 8 ) all_structs.append(TagCorrelationRequestV2) TagCorrelationRequestV2.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'noteType', None, None, ), # 2 (3, TType.LIST, 'tags', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.STRING, 'title', 'UTF8', None, ), # 5 (6, TType.STRING, 'content', 'UTF8', None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 8 ) all_structs.append(TagCorrelationResult) TagCorrelationResult.thrift_spec = ( None, # 0 (1, TType.MAP, 'confidences', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 1 ) all_structs.append(TagCorrelationResultV2) TagCorrelationResultV2.thrift_spec = ( None, # 0 (1, TType.MAP, 'confidences', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 1 ) all_structs.append(BrandClassifyResult) BrandClassifyResult.thrift_spec = ( None, # 0 (1, TType.MAP, 'confidences', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 1 ) all_structs.append(SearchDetectionResult) SearchDetectionResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'boxes', (TType.LIST, (TType.DOUBLE, None, False), False), None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.STRING, 'version', 'UTF8', None, ), # 3 ) all_structs.append(SearchEmbeddingResult) SearchEmbeddingResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'embedding', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.STRING, 'version', 'UTF8', None, ), # 2 ) all_structs.append(SearchClassificationResult) SearchClassificationResult.thrift_spec = ( None, # 0 (1, TType.MAP, 'classification_category_lv1', (TType.I32, None, TType.DOUBLE, None, False), None, ), # 1 (2, TType.MAP, 'classification_category_lv2', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 2 (3, TType.MAP, 'attributes', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 3 (4, TType.MAP, 'gender', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 4 (5, TType.STRING, 'version', 'UTF8', None, ), # 5 ) all_structs.append(SearchBoxInfoResult) SearchBoxInfoResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'box', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.LIST, 'embedding', (TType.DOUBLE, None, False), None, ), # 2 (3, TType.LIST, 'version', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.MAP, 'classification_category_lv1', (TType.I32, None, TType.DOUBLE, None, False), None, ), # 4 (5, TType.MAP, 'classification_category_lv2', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 5 (6, TType.MAP, 'attributes', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 6 ) all_structs.append(SearchBoxInfoResultRedCloud) SearchBoxInfoResultRedCloud.thrift_spec = ( None, # 0 (1, TType.STRING, 'detCat', 'UTF8', None, ), # 1 (2, TType.LIST, 'embedding', (TType.DOUBLE, None, False), None, ), # 2 (3, TType.LIST, 'version', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.DOUBLE, 'x1', None, None, ), # 4 (5, TType.DOUBLE, 'y1', None, None, ), # 5 (6, TType.DOUBLE, 'x2', None, None, ), # 6 (7, TType.DOUBLE, 'y2', None, None, ), # 7 ) all_structs.append(TimeSensitiveRequest) TimeSensitiveRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'title', 'UTF8', None, ), # 1 (2, TType.STRING, 'content', 'UTF8', None, ), # 2 ) all_structs.append(NEREntity) NEREntity.thrift_spec = ( None, # 0 (1, TType.STRING, 'type', 'UTF8', None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 (3, TType.I32, 'startPosition', None, None, ), # 3 (4, TType.I32, 'endPosition', None, None, ), # 4 (5, TType.DOUBLE, 'score', None, None, ), # 5 ) all_structs.append(NewNEREntity) NewNEREntity.thrift_spec = ( None, # 0 (1, TType.STRING, 'type', 'UTF8', None, ), # 1 (2, TType.STRING, 'secondaryType', 'UTF8', None, ), # 2 (3, TType.STRING, 'text', 'UTF8', None, ), # 3 (4, TType.I32, 'startPosition', None, None, ), # 4 (5, TType.I32, 'endPosition', None, None, ), # 5 (6, TType.DOUBLE, 'score', None, None, ), # 6 ) all_structs.append(NERResult) NERResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.STRING, 'textPredict', 'UTF8', None, ), # 2 (3, TType.LIST, 'entities', (TType.STRUCT, [NEREntity, None], False), None, ), # 3 ) all_structs.append(NewNERResult) NewNERResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.STRING, 'textPredict', 'UTF8', None, ), # 2 (3, TType.LIST, 'entities', (TType.STRUCT, [NewNEREntity, None], False), None, ), # 3 ) all_structs.append(NoteStructureResult) NoteStructureResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'key', 'UTF8', None, ), # 1 (2, TType.STRING, 'value', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 (4, TType.STRING, 'domain', 'UTF8', None, ), # 4 (5, TType.I32, 'freq', None, None, ), # 5 ) all_structs.append(LinkedEntity) LinkedEntity.thrift_spec = ( None, # 0 (1, TType.STRING, 'entityId', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 ) all_structs.append(EntityLinkResult) EntityLinkResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'linkedEntities', (TType.STRUCT, [LinkedEntity, None], False), None, ), # 1 ) all_structs.append(NoteStructureRequest) NoteStructureRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'cate', 'UTF8', None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) all_structs.append(GeneralNerResult) GeneralNerResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.STRING, 'textPredict', 'UTF8', None, ), # 2 (3, TType.LIST, 'noteEntities', (TType.STRUCT, [NoteStructureResult, None], False), None, ), # 3 (4, TType.LIST, 'standardEntities', (TType.STRUCT, [NEREntity, None], False), None, ), # 4 (5, TType.STRING, 'version', 'UTF8', None, ), # 5 ) all_structs.append(QueryNerResult) QueryNerResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'NERResults', (TType.STRUCT, [NERResult, None], False), None, ), # 1 ) all_structs.append(NewQueryNerResult) NewQueryNerResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'NERResults', (TType.STRUCT, [NewNERResult, None], False), None, ), # 1 ) all_structs.append(NoteFeedbackResult) NoteFeedbackResult.thrift_spec = ( None, # 0 (1, TType.I32, 'categoryId', None, None, ), # 1 (2, TType.STRING, 'categoryName', 'UTF8', None, ), # 2 ) all_structs.append(ImportanceResult) ImportanceResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'key', 'UTF8', None, ), # 1 (2, TType.STRING, 'value', 'UTF8', None, ), # 2 (3, TType.I32, 'importance', None, None, ), # 3 ) all_structs.append(ImportanceScoreResult) ImportanceScoreResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'ImpResults', (TType.STRUCT, [ImportanceResult, None], False), None, ), # 1 ) all_structs.append(AmazingCoverResult) AmazingCoverResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'keyFramePoints', (TType.DOUBLE, None, False), None, ), # 1 (2, TType.MAP, 'version', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 2 ) all_structs.append(NoteEmbeddingRequest) NoteEmbeddingRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'noteType', None, None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 8 ) all_structs.append(NoteEmbeddingResult) NoteEmbeddingResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'noteEmbedding', (TType.DOUBLE, None, False), None, ), # 1 ) all_structs.append(NoteInformationRequest) NoteInformationRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'noteType', None, None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.I32, 'duration', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.LIST, 'imageOcrs', (TType.STRING, 'UTF8', False), None, ), # 10 (11, TType.LIST, 'videoOcrs', (TType.STRING, 'UTF8', False), None, ), # 11 (12, TType.STRING, 'taxonomy1', 'UTF8', None, ), # 12 (13, TType.STRING, 'taxonomy2', 'UTF8', None, ), # 13 (14, TType.STRING, 'taxonomy3', 'UTF8', None, ), # 14 (15, TType.STRING, 'userFeatureJson', 'UTF8', None, ), # 15 ) all_structs.append(NoteInformationResult) NoteInformationResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'mcLabel', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'mcConfidence', None, None, ), # 2 (3, TType.STRING, 'eatLabel', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'eatConfidence', None, None, ), # 4 ) all_structs.append(NoteTimelinessRequest) NoteTimelinessRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.I32, 'noteType', None, None, ), # 2 (3, TType.I32, 'duration', None, None, ), # 3 (4, TType.STRING, 'createTime', 'UTF8', None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.LIST, 'imageOcrs', (TType.STRING, 'UTF8', False), None, ), # 10 (11, TType.LIST, 'videoOcrs', (TType.STRING, 'UTF8', False), None, ), # 11 (12, TType.STRING, 'taxonomy1', 'UTF8', None, ), # 12 (13, TType.STRING, 'taxonomy2', 'UTF8', None, ), # 13 (14, TType.STRING, 'taxonomy3', 'UTF8', None, ), # 14 ) all_structs.append(NoteTimelinessResult) NoteTimelinessResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'timeLineType', 'UTF8', None, ), # 1 (2, TType.STRING, 'expireTime', 'UTF8', None, ), # 2 ) all_structs.append(QueryEmbeddingResult) QueryEmbeddingResult.thrift_spec = ( None, # 0 (1, TType.MAP, 'queryEmbedding', (TType.STRING, 'UTF8', TType.LIST, (TType.DOUBLE, None, False), False), None, ), # 1 ) all_structs.append(QueryEmbeddingRequest) QueryEmbeddingRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'query', 'UTF8', None, ), # 1 ) all_structs.append(QueryLabelCorrelationRequest) QueryLabelCorrelationRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'content', 'UTF8', None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.LIST, 'recQueryList', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRING, 'title', 'UTF8', None, ), # 4 (5, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 6 ) all_structs.append(QueryLabelCorrelationResult) QueryLabelCorrelationResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'PredictQrList', (TType.STRUCT, [QueryLabelCorrelationItem, None], False), None, ), # 1 ) all_structs.append(QueryLabelCorrelationItem) QueryLabelCorrelationItem.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.STRING, 'tag', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 ) all_structs.append(DocGenerateQueryRequest) DocGenerateQueryRequest.thrift_spec = ( None, # 0 (1, TType.LIST, 'noteIdList', (TType.STRING, 'UTF8', False), None, ), # 1 (2, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.I32, 'generateQueryMaxCount', None, None, ), # 4 ) all_structs.append(DocGenerateQueryResult) DocGenerateQueryResult.thrift_spec = ( None, # 0 (1, TType.LIST, 'docGenerateQueryList', (TType.STRUCT, [DocGenerateQueryItem, None], False), None, ), # 1 ) all_structs.append(DocGenerateQueryItem) DocGenerateQueryItem.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.LIST, 'queryList', (TType.STRING, 'UTF8', False), None, ), # 2 ) all_structs.append(NoteIntentRequest) NoteIntentRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.STRING, 'title', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 ) all_structs.append(NoteIntentResult) NoteIntentResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'noteId', 'UTF8', None, ), # 1 (2, TType.STRING, 'intent', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'confidence', None, None, ), # 3 ) all_structs.append(QueryGeneralIntentRequest) QueryGeneralIntentRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.LIST, 'feature', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(QueryGeneralIntentV2Request) QueryGeneralIntentV2Request.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.STRING, 'nerDetail', 'UTF8', None, ), # 2 (3, TType.LIST, 'feature', (TType.DOUBLE, None, False), None, ), # 3 (4, TType.STRING, 'nerType', 'UTF8', None, ), # 4 (5, TType.STRING, 'tax1', 'UTF8', None, ), # 5 (6, TType.STRING, 'tax2', 'UTF8', None, ), # 6 ) all_structs.append(QueryQualityV2Request) QueryQualityV2Request.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'searchNum', None, None, ), # 2 (3, TType.DOUBLE, 'searchNumLabel', None, None, ), # 3 (4, TType.DOUBLE, 'pplScore', None, None, ), # 4 ) all_structs.append(QueryGeneralIntentResult) QueryGeneralIntentResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'intent', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'confidence', None, None, ), # 2 ) all_structs.append(QueryCorrectionResult) QueryCorrectionResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'correct', 'UTF8', None, ), # 1 (2, TType.LIST, 'confidence', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(QualityKenLMResult) QualityKenLMResult.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'score', None, None, ), # 1 ) all_structs.append(QueryQualityV2Result) QueryQualityV2Result.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'score', None, None, ), # 1 ) all_structs.append(BaikeEntityLinkFeat) BaikeEntityLinkFeat.thrift_spec = ( None, # 0 (1, TType.STRING, 'entityId', 'UTF8', None, ), # 1 (2, TType.STRING, 'disambiguationText', 'UTF8', None, ), # 2 (3, TType.STRING, 'summary', 'UTF8', None, ), # 3 (4, TType.STRING, 'basicInfo', 'UTF8', None, ), # 4 (5, TType.I32, 'popularity', None, None, ), # 5 (6, TType.DOUBLE, 'recallScore', None, None, ), # 6 (7, TType.STRING, 'anchorTexts', 'UTF8', None, ), # 7 (8, TType.STRING, 'entityType1', 'UTF8', None, ), # 8 (9, TType.STRING, 'entityType2', 'UTF8', None, ), # 9 (10, TType.STRING, 'name', 'UTF8', None, ), # 10 ) all_structs.append(poiLinkRankFeat) poiLinkRankFeat.thrift_spec = ( None, # 0 (1, TType.STRING, 'entityId', 'UTF8', None, ), # 1 (2, TType.STRING, 'name', 'UTF8', None, ), # 2 (3, TType.STRING, 'address', 'UTF8', None, ), # 3 (4, TType.STRING, 'type', 'UTF8', None, ), # 4 (5, TType.I32, 'popularity', None, None, ), # 5 (6, TType.DOUBLE, 'recallScore', None, None, ), # 6 ) all_structs.append(QuerySynonymRequest) QuerySynonymRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'query1', 'UTF8', None, ), # 1 (2, TType.STRING, 'query2', 'UTF8', None, ), # 2 ) all_structs.append(QuerySynonymResult) QuerySynonymResult.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'confidence', None, None, ), # 1 ) all_structs.append(NoteCategoryLinkCandidate) NoteCategoryLinkCandidate.thrift_spec = ( None, # 0 (1, TType.STRING, 'categoryId', 'UTF8', None, ), # 1 (2, TType.STRING, 'categoryName', 'UTF8', None, ), # 2 ) all_structs.append(GoodsSpuLinkCandidate) GoodsSpuLinkCandidate.thrift_spec = ( None, # 0 (1, TType.STRING, 'spuId', 'UTF8', None, ), # 1 (2, TType.STRING, 'spuName', 'UTF8', None, ), # 2 ) all_structs.append(NoteCategoryLinkResult) NoteCategoryLinkResult.thrift_spec = ( None, # 0 (1, TType.STRING, 'thirdEntityId', 'UTF8', None, ), # 1 (2, TType.DOUBLE, 'thirdConfidence', None, None, ), # 2 (3, TType.STRING, 'thirdEntityName', 'UTF8', None, ), # 3 (4, TType.STRING, 'fourthEntityId', 'UTF8', None, ), # 4 (5, TType.DOUBLE, 'fourthConfidence', None, None, ), # 5 (6, TType.STRING, 'fourthEntityName', 'UTF8', None, ), # 6 ) all_structs.append(CaesarCommonRequest) CaesarCommonRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'blsName', 'UTF8', None, ), # 1 (2, TType.STRING, 'jsonStringRequest', 'UTF8', None, ), # 2 ) all_structs.append(CaesarCommonResponse) CaesarCommonResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'result', [Result, None], None, ), # 1 (2, TType.STRING, 'jsonStringResult', 'UTF8', None, ), # 2 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/__init__.py ===== __all__ = ['ttypes', 'constants', 'BaseService', 'UtCaesarService'] ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/UtCaesarService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import titancaesar.thrift.caesar.BaseService import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(titancaesar.thrift.caesar.BaseService.Iface): def ping(self): pass def newGender(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def genderV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def LocalizationClassify(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def LocalizationClassifyWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def genderV3(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def highShow(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def sincere(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def badNote(self, ctx, text): """ Parameters: - ctx - text """ pass def badComment(self, ctx, text): """ Parameters: - ctx - text """ pass def aigoTrain(self, ctx, datasetPath, modelType, projectId, modelVersion, config): """ Parameters: - ctx - datasetPath - modelType - projectId - modelVersion - config """ pass def aigoTest(self, ctx, materials, modelType, modelPath): """ Parameters: - ctx - materials - modelType - modelPath """ pass def commentClassify(self, ctx, text, sameAuthor, contextText): """ Parameters: - ctx - text - sameAuthor - contextText """ pass def commentClassifyV2(self, ctx, request): """ Parameters: - ctx - request """ pass def commentSecurityClassify(self, ctx, request): """ Parameters: - ctx - request """ pass def commentOrderClassify(self, ctx, request): """ Parameters: - ctx - request """ pass def commentClassifyTest(self, ctx, request): """ Parameters: - ctx - request """ pass def danmuSentiment(self, ctx, request): """ Parameters: - ctx - request """ pass def danmuSentiment_apple(self, ctx, request): """ Parameters: - ctx - request """ pass def accusation(self, ctx, commentId, comment, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - commentId - comment - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def taxonomy(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def taxonomyV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def taxonomyW2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def audioFinger(self, ctx, noteId, noteType, videoKey): """ Parameters: - ctx - noteId - noteType - videoKey """ pass def knowledge(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def noteSecurity(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def advertise(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ pass def giftBox(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ pass def giftBoxV2(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ pass def fashion(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def feedbackClassify(self, ctx, ticketNo, content, scenarioByUser, categoryByCUser): """ Parameters: - ctx - ticketNo - content - scenarioByUser - categoryByCUser """ pass def tagClassification(self, ctx, imgUrl, text): """ Parameters: - ctx - imgUrl - text """ pass def customerConversationClassify(self, ctx, caseId, chatId, turns): """ Parameters: - ctx - caseId - chatId - turns """ pass def customerConversationClassifyV2(self, ctx, caseId, chatId, turns): """ Parameters: - ctx - caseId - chatId - turns """ pass def cover(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def uncomfortable(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def aestheticAssessment(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def realphoto(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def ctrEmbedding(self, ctx, noteId, imgUrls): """ Parameters: - ctx - noteId - imgUrls """ pass def ctrForSearch(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def suspectUser(self, ctx, request): """ Parameters: - ctx - request """ pass def ctrRanking(self, ctx, noteId, imgUrls): """ Parameters: - ctx - noteId - imgUrls """ pass def videoTagging(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def newTopic(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def newTopicV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def newConceptionV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, imageOcrList, videoOcrList, searchTaxonomy1, searchTaxonomy2, noteTaxonomy1, noteTaxonomy2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - imageOcrList - videoOcrList - searchTaxonomy1 - searchTaxonomy2 - noteTaxonomy1 - noteTaxonomy2 """ pass def newTagV3(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ pass def newTopicPostRule(self, ctx, noteId, topicList, titleList, contentList, resultList, confList): """ Parameters: - ctx - noteId - topicList - titleList - contentList - resultList - confList """ pass def antiSEOV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, query_list, note_tax1_list, note_tax2_list, tag_tax1_list, tag_tax2_list): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - query_list - note_tax1_list - note_tax2_list - tag_tax1_list - tag_tax2_list """ pass def newTopicWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def newTopicV2Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def newTagV3Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ pass def cdn2redkvWiper(self, ctx, note_id_list, note_type_list, image_list_list, key_frame_list_list): """ Parameters: - ctx - note_id_list - note_type_list - image_list_list - key_frame_list_list """ pass def videoEmbedding(self, ctx, noteId, text, imgUrls): """ Parameters: - ctx - noteId - text - imgUrls """ pass def normalEmbedding(self, ctx, noteId, imgUrls, title, content, huati): """ Parameters: - ctx - noteId - imgUrls - title - content - huati """ pass def commentInsult(self, ctx, text): """ Parameters: - ctx - text """ pass def dishNer(self, ctx, text): """ Parameters: - ctx - text """ pass def detect(self, ctx, imageUrl): """ Parameters: - ctx - imageUrl """ pass def faceRecognition(self, ctx, imgUrl, returnEmbedding): """ Parameters: - ctx - imgUrl - returnEmbedding """ pass def querySimilarWords(self, ctx, word, num): """ Parameters: - ctx - word - num """ pass def getSimilarity(self, ctx, word1, word2): """ Parameters: - ctx - word1 - word2 """ pass def isDupPoi(self, ctx, vec, category): """ Parameters: - ctx - vec - category """ pass def musicDssmEmbedding(self, ctx, imgUrl, topK): """ Parameters: - ctx - imgUrl - topK """ pass def getImageClassification(self, ctx, imgUrl, modelType): """ Parameters: - ctx - imgUrl - modelType """ pass def isDupSpvV1(self, ctx, leftName, rightName, featureStr): """ Parameters: - ctx - leftName - rightName - featureStr """ pass def sentimentAnalysis(self, ctx, text): """ Parameters: - ctx - text """ pass def topicDssmEmbedding(self, ctx, title, content, imgUrl): """ Parameters: - ctx - title - content - imgUrl """ pass def splitSentence(self, ctx, texts): """ Parameters: - ctx - texts """ pass def universalNer(self, ctx, texts): """ Parameters: - ctx - texts """ pass def universalNerV2(self, ctx, texts): """ Parameters: - ctx - texts """ pass def universalNerV3(self, ctx, texts, types): """ Parameters: - ctx - texts - types """ pass def brandClassify(self, ctx, texts): """ Parameters: - ctx - texts """ pass def brandClassifyV2(self, ctx, brandNames, title, content): """ Parameters: - ctx - brandNames - title - content """ pass def timeSensitiveClassify(self, ctx, title, content): """ Parameters: - ctx - title - content """ pass def whiteBoxCartoonize(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def superResolution(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def noteEcology(self, ctx, request): """ Parameters: - ctx - request """ pass def noteQuality(self, ctx, request): """ Parameters: - ctx - request """ pass def noteQualityV5(self, ctx, request): """ Parameters: - ctx - request """ pass def petDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def tagCorrelation(self, ctx, request): """ Parameters: - ctx - request """ pass def tagCorrelationV2(self, ctx, request): """ Parameters: - ctx - request """ pass def searchDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def searchOfflineDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def searchEmbedding(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ pass def searchClassification(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ pass def searchClassificationOffline(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ pass def searchPipeline(self, ctx, imgUrl, useClassification): """ Parameters: - ctx - imgUrl - useClassification """ pass def searchOfflinePipeline(self, ctx, imgUrl, useClassification): """ Parameters: - ctx - imgUrl - useClassification """ pass def searchRedCloudPipeline(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def searchGisRedCloudPipeline(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ pass def noteStructure(self, ctx, cate, text): """ Parameters: - ctx - cate - text """ pass def baikeEntityLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def baikeEntityLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def poiLinkRank(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def noteCategoryLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def goodsSpuLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def goodsSpuLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ pass def generalEntityExtract(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ pass def generalEntityExtractV2(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ pass def generalEntityExtractV3(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ pass def generalEntityExtractV4(self, ctx, note_id, cate, texts): """ Parameters: - ctx - note_id - cate - texts """ pass def generalEntityExtractV4Wiper(self, ctx, note_id, cate, texts): """ Parameters: - ctx - note_id - cate - texts """ pass def generalEntityClassifyV4(self, ctx, note_id, cate, entities, entityFeature): """ Parameters: - ctx - note_id - cate - entities - entityFeature """ pass def generalEntityClassifyV4Wiper(self, ctx, note_id, cate, entities, entityFeature): """ Parameters: - ctx - note_id - cate - entities - entityFeature """ pass def generalEntityRelationV4(self, ctx, note_id, cate, text, entities): """ Parameters: - ctx - note_id - cate - text - entities """ pass def generalEntityRelationV4Wiper(self, ctx, note_id, cate, text, entities): """ Parameters: - ctx - note_id - cate - text - entities """ pass def generalEntityExtractWiper(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ pass def importanceScore(self, ctx, note_id, cate, text, entity_rst, usr_tag): """ Parameters: - ctx - note_id - cate - text - entity_rst - usr_tag """ pass def importanceWiper(self, ctx, note_id, cate, text, entity_rst, usr_tag): """ Parameters: - ctx - note_id - cate - text - entity_rst - usr_tag """ pass def importanceScoreV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ pass def importanceWiperV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ pass def importanceScoreV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ pass def importanceScoreV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ pass def importanceWiperV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ pass def importanceScoreV5Test(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ pass def importanceWiperV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ pass def importanceScoreV4Test(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ pass def queryNER(self, ctx, texts): """ Parameters: - ctx - texts """ pass def queryNERV2(self, ctx, texts): """ Parameters: - ctx - texts """ pass def queryNERV3(self, ctx, texts): """ Parameters: - ctx - texts """ pass def queryNERV4(self, ctx, texts): """ Parameters: - ctx - texts """ pass def sentNER(self, ctx, texts): """ Parameters: - ctx - texts """ pass def sentNERLatest(self, ctx, texts): """ Parameters: - ctx - texts """ pass def noteFeedback(self, ctx, note_id, title, content): """ Parameters: - ctx - note_id - title - content """ pass def noteFeedbackV2(self, ctx, note_id, title, content): """ Parameters: - ctx - note_id - title - content """ pass def amazingCover(self, ctx, key_frames): """ Parameters: - ctx - key_frames """ pass def noteEmbedding(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def noteEmbeddingWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ pass def noteInformationClassify(self, ctx, request): """ Parameters: - ctx - request """ pass def noteInformationClassifyV2(self, ctx, request): """ Parameters: - ctx - request """ pass def noteInformationClassifyV2Wiper(self, ctx, request): """ Parameters: - ctx - request """ pass def noteTimelinessClassify(self, ctx, request): """ Parameters: - ctx - request """ pass def noteTimelinessClassifyWiper(self, ctx, request): """ Parameters: - ctx - request """ pass def queryEmbedding(self, ctx, query): """ Parameters: - ctx - query """ pass def queryEmbeddingV2(self, ctx, query): """ Parameters: - ctx - query """ pass def queryBatchEmbeddingV2(self, ctx, query): """ Parameters: - ctx - query """ pass def getLabelCorrelation(self, ctx, request): """ Parameters: - ctx - request """ pass def getDocGenerateQuery(self, ctx, request): """ Parameters: - ctx - request """ pass def baikeParse(self, ctx, url): """ Parameters: - ctx - url """ pass def baikeParseWiper(self, ctx, url): """ Parameters: - ctx - url """ pass def getNoteIntent(self, ctx, request): """ Parameters: - ctx - request """ pass def getQueryGeneralIntent(self, ctx, request): """ Parameters: - ctx - request """ pass def getQueryGeneralIntentV2(self, ctx, request): """ Parameters: - ctx - request """ pass def getQueryQualityV2(self, ctx, request): """ Parameters: - ctx - request """ pass def getQueryCorrection(self, ctx, texts): """ Parameters: - ctx - texts """ pass def getQualityPPL(self, ctx, texts): """ Parameters: - ctx - texts """ pass def getQuerySynonym(self, ctx, request): """ Parameters: - ctx - request """ pass def caesarCommonQuery(self, ctx, caesarCommonRequest): """ Parameters: - ctx - caesarCommonRequest """ pass class Client(titancaesar.thrift.caesar.BaseService.Client, Iface): def __init__(self, iprot, oprot=None): titancaesar.thrift.caesar.BaseService.Client.__init__(self, iprot, oprot) def ping(self): self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return def newGender(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_newGender(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_newGender() def send_newGender(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('newGender', TMessageType.CALL, self._seqid) args = newGender_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newGender(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newGender_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newGender failed: unknown result") def genderV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_genderV2(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_genderV2() def send_genderV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('genderV2', TMessageType.CALL, self._seqid) args = genderV2_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_genderV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = genderV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "genderV2 failed: unknown result") def LocalizationClassify(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_LocalizationClassify(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_LocalizationClassify() def send_LocalizationClassify(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('LocalizationClassify', TMessageType.CALL, self._seqid) args = LocalizationClassify_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_LocalizationClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = LocalizationClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "LocalizationClassify failed: unknown result") def LocalizationClassifyWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_LocalizationClassifyWiper(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_LocalizationClassifyWiper() def send_LocalizationClassifyWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('LocalizationClassifyWiper', TMessageType.CALL, self._seqid) args = LocalizationClassifyWiper_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_LocalizationClassifyWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = LocalizationClassifyWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "LocalizationClassifyWiper failed: unknown result") def genderV3(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_genderV3(ctx, imgUrl) return self.recv_genderV3() def send_genderV3(self, ctx, imgUrl): self._oprot.writeMessageBegin('genderV3', TMessageType.CALL, self._seqid) args = genderV3_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_genderV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = genderV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "genderV3 failed: unknown result") def highShow(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_highShow(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_highShow() def send_highShow(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('highShow', TMessageType.CALL, self._seqid) args = highShow_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_highShow(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = highShow_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "highShow failed: unknown result") def sincere(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_sincere(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_sincere() def send_sincere(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('sincere', TMessageType.CALL, self._seqid) args = sincere_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sincere(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sincere_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "sincere failed: unknown result") def badNote(self, ctx, text): """ Parameters: - ctx - text """ self.send_badNote(ctx, text) return self.recv_badNote() def send_badNote(self, ctx, text): self._oprot.writeMessageBegin('badNote', TMessageType.CALL, self._seqid) args = badNote_args() args.ctx = ctx args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_badNote(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = badNote_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "badNote failed: unknown result") def badComment(self, ctx, text): """ Parameters: - ctx - text """ self.send_badComment(ctx, text) return self.recv_badComment() def send_badComment(self, ctx, text): self._oprot.writeMessageBegin('badComment', TMessageType.CALL, self._seqid) args = badComment_args() args.ctx = ctx args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_badComment(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = badComment_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "badComment failed: unknown result") def aigoTrain(self, ctx, datasetPath, modelType, projectId, modelVersion, config): """ Parameters: - ctx - datasetPath - modelType - projectId - modelVersion - config """ self.send_aigoTrain(ctx, datasetPath, modelType, projectId, modelVersion, config) return self.recv_aigoTrain() def send_aigoTrain(self, ctx, datasetPath, modelType, projectId, modelVersion, config): self._oprot.writeMessageBegin('aigoTrain', TMessageType.CALL, self._seqid) args = aigoTrain_args() args.ctx = ctx args.datasetPath = datasetPath args.modelType = modelType args.projectId = projectId args.modelVersion = modelVersion args.config = config args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_aigoTrain(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = aigoTrain_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "aigoTrain failed: unknown result") def aigoTest(self, ctx, materials, modelType, modelPath): """ Parameters: - ctx - materials - modelType - modelPath """ self.send_aigoTest(ctx, materials, modelType, modelPath) return self.recv_aigoTest() def send_aigoTest(self, ctx, materials, modelType, modelPath): self._oprot.writeMessageBegin('aigoTest', TMessageType.CALL, self._seqid) args = aigoTest_args() args.ctx = ctx args.materials = materials args.modelType = modelType args.modelPath = modelPath args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_aigoTest(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = aigoTest_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "aigoTest failed: unknown result") def commentClassify(self, ctx, text, sameAuthor, contextText): """ Parameters: - ctx - text - sameAuthor - contextText """ self.send_commentClassify(ctx, text, sameAuthor, contextText) return self.recv_commentClassify() def send_commentClassify(self, ctx, text, sameAuthor, contextText): self._oprot.writeMessageBegin('commentClassify', TMessageType.CALL, self._seqid) args = commentClassify_args() args.ctx = ctx args.text = text args.sameAuthor = sameAuthor args.contextText = contextText args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentClassify failed: unknown result") def commentClassifyV2(self, ctx, request): """ Parameters: - ctx - request """ self.send_commentClassifyV2(ctx, request) return self.recv_commentClassifyV2() def send_commentClassifyV2(self, ctx, request): self._oprot.writeMessageBegin('commentClassifyV2', TMessageType.CALL, self._seqid) args = commentClassifyV2_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentClassifyV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentClassifyV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentClassifyV2 failed: unknown result") def commentSecurityClassify(self, ctx, request): """ Parameters: - ctx - request """ self.send_commentSecurityClassify(ctx, request) return self.recv_commentSecurityClassify() def send_commentSecurityClassify(self, ctx, request): self._oprot.writeMessageBegin('commentSecurityClassify', TMessageType.CALL, self._seqid) args = commentSecurityClassify_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentSecurityClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentSecurityClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentSecurityClassify failed: unknown result") def commentOrderClassify(self, ctx, request): """ Parameters: - ctx - request """ self.send_commentOrderClassify(ctx, request) return self.recv_commentOrderClassify() def send_commentOrderClassify(self, ctx, request): self._oprot.writeMessageBegin('commentOrderClassify', TMessageType.CALL, self._seqid) args = commentOrderClassify_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentOrderClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentOrderClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentOrderClassify failed: unknown result") def commentClassifyTest(self, ctx, request): """ Parameters: - ctx - request """ self.send_commentClassifyTest(ctx, request) return self.recv_commentClassifyTest() def send_commentClassifyTest(self, ctx, request): self._oprot.writeMessageBegin('commentClassifyTest', TMessageType.CALL, self._seqid) args = commentClassifyTest_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentClassifyTest(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentClassifyTest_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentClassifyTest failed: unknown result") def danmuSentiment(self, ctx, request): """ Parameters: - ctx - request """ self.send_danmuSentiment(ctx, request) return self.recv_danmuSentiment() def send_danmuSentiment(self, ctx, request): self._oprot.writeMessageBegin('danmuSentiment', TMessageType.CALL, self._seqid) args = danmuSentiment_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_danmuSentiment(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = danmuSentiment_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "danmuSentiment failed: unknown result") def danmuSentiment_apple(self, ctx, request): """ Parameters: - ctx - request """ self.send_danmuSentiment_apple(ctx, request) return self.recv_danmuSentiment_apple() def send_danmuSentiment_apple(self, ctx, request): self._oprot.writeMessageBegin('danmuSentiment_apple', TMessageType.CALL, self._seqid) args = danmuSentiment_apple_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_danmuSentiment_apple(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = danmuSentiment_apple_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "danmuSentiment_apple failed: unknown result") def accusation(self, ctx, commentId, comment, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - commentId - comment - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_accusation(ctx, commentId, comment, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_accusation() def send_accusation(self, ctx, commentId, comment, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('accusation', TMessageType.CALL, self._seqid) args = accusation_args() args.ctx = ctx args.commentId = commentId args.comment = comment args.noteId = noteId args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_accusation(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = accusation_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "accusation failed: unknown result") def taxonomy(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_taxonomy(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_taxonomy() def send_taxonomy(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('taxonomy', TMessageType.CALL, self._seqid) args = taxonomy_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_taxonomy(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = taxonomy_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "taxonomy failed: unknown result") def taxonomyV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_taxonomyV2(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_taxonomyV2() def send_taxonomyV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('taxonomyV2', TMessageType.CALL, self._seqid) args = taxonomyV2_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_taxonomyV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = taxonomyV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "taxonomyV2 failed: unknown result") def taxonomyW2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_taxonomyW2(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_taxonomyW2() def send_taxonomyW2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('taxonomyW2', TMessageType.CALL, self._seqid) args = taxonomyW2_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_taxonomyW2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = taxonomyW2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "taxonomyW2 failed: unknown result") def audioFinger(self, ctx, noteId, noteType, videoKey): """ Parameters: - ctx - noteId - noteType - videoKey """ self.send_audioFinger(ctx, noteId, noteType, videoKey) return self.recv_audioFinger() def send_audioFinger(self, ctx, noteId, noteType, videoKey): self._oprot.writeMessageBegin('audioFinger', TMessageType.CALL, self._seqid) args = audioFinger_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.videoKey = videoKey args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_audioFinger(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = audioFinger_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "audioFinger failed: unknown result") def knowledge(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_knowledge(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_knowledge() def send_knowledge(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('knowledge', TMessageType.CALL, self._seqid) args = knowledge_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_knowledge(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = knowledge_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "knowledge failed: unknown result") def noteSecurity(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_noteSecurity(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_noteSecurity() def send_noteSecurity(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('noteSecurity', TMessageType.CALL, self._seqid) args = noteSecurity_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteSecurity(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteSecurity_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteSecurity failed: unknown result") def advertise(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ self.send_advertise(ctx, noteId, useCache, topicList, titleList, contentList, imageList) return self.recv_advertise() def send_advertise(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): self._oprot.writeMessageBegin('advertise', TMessageType.CALL, self._seqid) args = advertise_args() args.ctx = ctx args.noteId = noteId args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_advertise(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = advertise_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "advertise failed: unknown result") def giftBox(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ self.send_giftBox(ctx, noteId, useCache, topicList, titleList, contentList, imageList) return self.recv_giftBox() def send_giftBox(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): self._oprot.writeMessageBegin('giftBox', TMessageType.CALL, self._seqid) args = giftBox_args() args.ctx = ctx args.noteId = noteId args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_giftBox(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = giftBox_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "giftBox failed: unknown result") def giftBoxV2(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ self.send_giftBoxV2(ctx, noteId, useCache, topicList, titleList, contentList, imageList) return self.recv_giftBoxV2() def send_giftBoxV2(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList): self._oprot.writeMessageBegin('giftBoxV2', TMessageType.CALL, self._seqid) args = giftBoxV2_args() args.ctx = ctx args.noteId = noteId args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_giftBoxV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = giftBoxV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "giftBoxV2 failed: unknown result") def fashion(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_fashion(ctx, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_fashion() def send_fashion(self, ctx, noteId, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('fashion', TMessageType.CALL, self._seqid) args = fashion_args() args.ctx = ctx args.noteId = noteId args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_fashion(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = fashion_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "fashion failed: unknown result") def feedbackClassify(self, ctx, ticketNo, content, scenarioByUser, categoryByCUser): """ Parameters: - ctx - ticketNo - content - scenarioByUser - categoryByCUser """ self.send_feedbackClassify(ctx, ticketNo, content, scenarioByUser, categoryByCUser) return self.recv_feedbackClassify() def send_feedbackClassify(self, ctx, ticketNo, content, scenarioByUser, categoryByCUser): self._oprot.writeMessageBegin('feedbackClassify', TMessageType.CALL, self._seqid) args = feedbackClassify_args() args.ctx = ctx args.ticketNo = ticketNo args.content = content args.scenarioByUser = scenarioByUser args.categoryByCUser = categoryByCUser args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_feedbackClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = feedbackClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "feedbackClassify failed: unknown result") def tagClassification(self, ctx, imgUrl, text): """ Parameters: - ctx - imgUrl - text """ self.send_tagClassification(ctx, imgUrl, text) return self.recv_tagClassification() def send_tagClassification(self, ctx, imgUrl, text): self._oprot.writeMessageBegin('tagClassification', TMessageType.CALL, self._seqid) args = tagClassification_args() args.ctx = ctx args.imgUrl = imgUrl args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_tagClassification(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = tagClassification_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "tagClassification failed: unknown result") def customerConversationClassify(self, ctx, caseId, chatId, turns): """ Parameters: - ctx - caseId - chatId - turns """ self.send_customerConversationClassify(ctx, caseId, chatId, turns) return self.recv_customerConversationClassify() def send_customerConversationClassify(self, ctx, caseId, chatId, turns): self._oprot.writeMessageBegin('customerConversationClassify', TMessageType.CALL, self._seqid) args = customerConversationClassify_args() args.ctx = ctx args.caseId = caseId args.chatId = chatId args.turns = turns args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_customerConversationClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = customerConversationClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "customerConversationClassify failed: unknown result") def customerConversationClassifyV2(self, ctx, caseId, chatId, turns): """ Parameters: - ctx - caseId - chatId - turns """ self.send_customerConversationClassifyV2(ctx, caseId, chatId, turns) return self.recv_customerConversationClassifyV2() def send_customerConversationClassifyV2(self, ctx, caseId, chatId, turns): self._oprot.writeMessageBegin('customerConversationClassifyV2', TMessageType.CALL, self._seqid) args = customerConversationClassifyV2_args() args.ctx = ctx args.caseId = caseId args.chatId = chatId args.turns = turns args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_customerConversationClassifyV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = customerConversationClassifyV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "customerConversationClassifyV2 failed: unknown result") def cover(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_cover(ctx, imgUrl) return self.recv_cover() def send_cover(self, ctx, imgUrl): self._oprot.writeMessageBegin('cover', TMessageType.CALL, self._seqid) args = cover_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_cover(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = cover_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "cover failed: unknown result") def uncomfortable(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_uncomfortable(ctx, imgUrl) return self.recv_uncomfortable() def send_uncomfortable(self, ctx, imgUrl): self._oprot.writeMessageBegin('uncomfortable', TMessageType.CALL, self._seqid) args = uncomfortable_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_uncomfortable(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = uncomfortable_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "uncomfortable failed: unknown result") def aestheticAssessment(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_aestheticAssessment(ctx, imgUrl) return self.recv_aestheticAssessment() def send_aestheticAssessment(self, ctx, imgUrl): self._oprot.writeMessageBegin('aestheticAssessment', TMessageType.CALL, self._seqid) args = aestheticAssessment_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_aestheticAssessment(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = aestheticAssessment_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "aestheticAssessment failed: unknown result") def realphoto(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_realphoto(ctx, imgUrl) return self.recv_realphoto() def send_realphoto(self, ctx, imgUrl): self._oprot.writeMessageBegin('realphoto', TMessageType.CALL, self._seqid) args = realphoto_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_realphoto(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = realphoto_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "realphoto failed: unknown result") def ctrEmbedding(self, ctx, noteId, imgUrls): """ Parameters: - ctx - noteId - imgUrls """ self.send_ctrEmbedding(ctx, noteId, imgUrls) return self.recv_ctrEmbedding() def send_ctrEmbedding(self, ctx, noteId, imgUrls): self._oprot.writeMessageBegin('ctrEmbedding', TMessageType.CALL, self._seqid) args = ctrEmbedding_args() args.ctx = ctx args.noteId = noteId args.imgUrls = imgUrls args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ctrEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ctrEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ctrEmbedding failed: unknown result") def ctrForSearch(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_ctrForSearch(ctx, imgUrl) return self.recv_ctrForSearch() def send_ctrForSearch(self, ctx, imgUrl): self._oprot.writeMessageBegin('ctrForSearch', TMessageType.CALL, self._seqid) args = ctrForSearch_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ctrForSearch(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ctrForSearch_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ctrForSearch failed: unknown result") def suspectUser(self, ctx, request): """ Parameters: - ctx - request """ self.send_suspectUser(ctx, request) return self.recv_suspectUser() def send_suspectUser(self, ctx, request): self._oprot.writeMessageBegin('suspectUser', TMessageType.CALL, self._seqid) args = suspectUser_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_suspectUser(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = suspectUser_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "suspectUser failed: unknown result") def ctrRanking(self, ctx, noteId, imgUrls): """ Parameters: - ctx - noteId - imgUrls """ self.send_ctrRanking(ctx, noteId, imgUrls) return self.recv_ctrRanking() def send_ctrRanking(self, ctx, noteId, imgUrls): self._oprot.writeMessageBegin('ctrRanking', TMessageType.CALL, self._seqid) args = ctrRanking_args() args.ctx = ctx args.noteId = noteId args.imgUrls = imgUrls args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ctrRanking(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ctrRanking_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ctrRanking failed: unknown result") def videoTagging(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_videoTagging(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_videoTagging() def send_videoTagging(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('videoTagging', TMessageType.CALL, self._seqid) args = videoTagging_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_videoTagging(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = videoTagging_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "videoTagging failed: unknown result") def newTopic(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_newTopic(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_newTopic() def send_newTopic(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('newTopic', TMessageType.CALL, self._seqid) args = newTopic_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTopic(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTopic_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTopic failed: unknown result") def newTopicV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_newTopicV2(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_newTopicV2() def send_newTopicV2(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('newTopicV2', TMessageType.CALL, self._seqid) args = newTopicV2_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTopicV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTopicV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTopicV2 failed: unknown result") def newConceptionV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, imageOcrList, videoOcrList, searchTaxonomy1, searchTaxonomy2, noteTaxonomy1, noteTaxonomy2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - imageOcrList - videoOcrList - searchTaxonomy1 - searchTaxonomy2 - noteTaxonomy1 - noteTaxonomy2 """ self.send_newConceptionV1(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, imageOcrList, videoOcrList, searchTaxonomy1, searchTaxonomy2, noteTaxonomy1, noteTaxonomy2) return self.recv_newConceptionV1() def send_newConceptionV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, imageOcrList, videoOcrList, searchTaxonomy1, searchTaxonomy2, noteTaxonomy1, noteTaxonomy2): self._oprot.writeMessageBegin('newConceptionV1', TMessageType.CALL, self._seqid) args = newConceptionV1_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.imageOcrList = imageOcrList args.videoOcrList = videoOcrList args.searchTaxonomy1 = searchTaxonomy1 args.searchTaxonomy2 = searchTaxonomy2 args.noteTaxonomy1 = noteTaxonomy1 args.noteTaxonomy2 = noteTaxonomy2 args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newConceptionV1(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newConceptionV1_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newConceptionV1 failed: unknown result") def newTagV3(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ self.send_newTagV3(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2) return self.recv_newTagV3() def send_newTagV3(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): self._oprot.writeMessageBegin('newTagV3', TMessageType.CALL, self._seqid) args = newTagV3_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.tax1 = tax1 args.tax2 = tax2 args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTagV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTagV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTagV3 failed: unknown result") def newTopicPostRule(self, ctx, noteId, topicList, titleList, contentList, resultList, confList): """ Parameters: - ctx - noteId - topicList - titleList - contentList - resultList - confList """ self.send_newTopicPostRule(ctx, noteId, topicList, titleList, contentList, resultList, confList) return self.recv_newTopicPostRule() def send_newTopicPostRule(self, ctx, noteId, topicList, titleList, contentList, resultList, confList): self._oprot.writeMessageBegin('newTopicPostRule', TMessageType.CALL, self._seqid) args = newTopicPostRule_args() args.ctx = ctx args.noteId = noteId args.topicList = topicList args.titleList = titleList args.contentList = contentList args.resultList = resultList args.confList = confList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTopicPostRule(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTopicPostRule_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTopicPostRule failed: unknown result") def antiSEOV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, query_list, note_tax1_list, note_tax2_list, tag_tax1_list, tag_tax2_list): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - query_list - note_tax1_list - note_tax2_list - tag_tax1_list - tag_tax2_list """ self.send_antiSEOV1(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, query_list, note_tax1_list, note_tax2_list, tag_tax1_list, tag_tax2_list) return self.recv_antiSEOV1() def send_antiSEOV1(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, query_list, note_tax1_list, note_tax2_list, tag_tax1_list, tag_tax2_list): self._oprot.writeMessageBegin('antiSEOV1', TMessageType.CALL, self._seqid) args = antiSEOV1_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.query_list = query_list args.note_tax1_list = note_tax1_list args.note_tax2_list = note_tax2_list args.tag_tax1_list = tag_tax1_list args.tag_tax2_list = tag_tax2_list args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_antiSEOV1(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = antiSEOV1_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "antiSEOV1 failed: unknown result") def newTopicWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_newTopicWiper(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_newTopicWiper() def send_newTopicWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('newTopicWiper', TMessageType.CALL, self._seqid) args = newTopicWiper_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTopicWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTopicWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTopicWiper failed: unknown result") def newTopicV2Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_newTopicV2Wiper(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_newTopicV2Wiper() def send_newTopicV2Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('newTopicV2Wiper', TMessageType.CALL, self._seqid) args = newTopicV2Wiper_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTopicV2Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTopicV2Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTopicV2Wiper failed: unknown result") def newTagV3Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ self.send_newTagV3Wiper(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2) return self.recv_newTagV3Wiper() def send_newTagV3Wiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList, tax1, tax2): self._oprot.writeMessageBegin('newTagV3Wiper', TMessageType.CALL, self._seqid) args = newTagV3Wiper_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.tax1 = tax1 args.tax2 = tax2 args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_newTagV3Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = newTagV3Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "newTagV3Wiper failed: unknown result") def cdn2redkvWiper(self, ctx, note_id_list, note_type_list, image_list_list, key_frame_list_list): """ Parameters: - ctx - note_id_list - note_type_list - image_list_list - key_frame_list_list """ self.send_cdn2redkvWiper(ctx, note_id_list, note_type_list, image_list_list, key_frame_list_list) return self.recv_cdn2redkvWiper() def send_cdn2redkvWiper(self, ctx, note_id_list, note_type_list, image_list_list, key_frame_list_list): self._oprot.writeMessageBegin('cdn2redkvWiper', TMessageType.CALL, self._seqid) args = cdn2redkvWiper_args() args.ctx = ctx args.note_id_list = note_id_list args.note_type_list = note_type_list args.image_list_list = image_list_list args.key_frame_list_list = key_frame_list_list args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_cdn2redkvWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = cdn2redkvWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "cdn2redkvWiper failed: unknown result") def videoEmbedding(self, ctx, noteId, text, imgUrls): """ Parameters: - ctx - noteId - text - imgUrls """ self.send_videoEmbedding(ctx, noteId, text, imgUrls) return self.recv_videoEmbedding() def send_videoEmbedding(self, ctx, noteId, text, imgUrls): self._oprot.writeMessageBegin('videoEmbedding', TMessageType.CALL, self._seqid) args = videoEmbedding_args() args.ctx = ctx args.noteId = noteId args.text = text args.imgUrls = imgUrls args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_videoEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = videoEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "videoEmbedding failed: unknown result") def normalEmbedding(self, ctx, noteId, imgUrls, title, content, huati): """ Parameters: - ctx - noteId - imgUrls - title - content - huati """ self.send_normalEmbedding(ctx, noteId, imgUrls, title, content, huati) return self.recv_normalEmbedding() def send_normalEmbedding(self, ctx, noteId, imgUrls, title, content, huati): self._oprot.writeMessageBegin('normalEmbedding', TMessageType.CALL, self._seqid) args = normalEmbedding_args() args.ctx = ctx args.noteId = noteId args.imgUrls = imgUrls args.title = title args.content = content args.huati = huati args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_normalEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = normalEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "normalEmbedding failed: unknown result") def commentInsult(self, ctx, text): """ Parameters: - ctx - text """ self.send_commentInsult(ctx, text) return self.recv_commentInsult() def send_commentInsult(self, ctx, text): self._oprot.writeMessageBegin('commentInsult', TMessageType.CALL, self._seqid) args = commentInsult_args() args.ctx = ctx args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_commentInsult(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = commentInsult_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "commentInsult failed: unknown result") def dishNer(self, ctx, text): """ Parameters: - ctx - text """ self.send_dishNer(ctx, text) return self.recv_dishNer() def send_dishNer(self, ctx, text): self._oprot.writeMessageBegin('dishNer', TMessageType.CALL, self._seqid) args = dishNer_args() args.ctx = ctx args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_dishNer(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = dishNer_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "dishNer failed: unknown result") def detect(self, ctx, imageUrl): """ Parameters: - ctx - imageUrl """ self.send_detect(ctx, imageUrl) return self.recv_detect() def send_detect(self, ctx, imageUrl): self._oprot.writeMessageBegin('detect', TMessageType.CALL, self._seqid) args = detect_args() args.ctx = ctx args.imageUrl = imageUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_detect(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = detect_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "detect failed: unknown result") def faceRecognition(self, ctx, imgUrl, returnEmbedding): """ Parameters: - ctx - imgUrl - returnEmbedding """ self.send_faceRecognition(ctx, imgUrl, returnEmbedding) return self.recv_faceRecognition() def send_faceRecognition(self, ctx, imgUrl, returnEmbedding): self._oprot.writeMessageBegin('faceRecognition', TMessageType.CALL, self._seqid) args = faceRecognition_args() args.ctx = ctx args.imgUrl = imgUrl args.returnEmbedding = returnEmbedding args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_faceRecognition(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = faceRecognition_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "faceRecognition failed: unknown result") def querySimilarWords(self, ctx, word, num): """ Parameters: - ctx - word - num """ self.send_querySimilarWords(ctx, word, num) return self.recv_querySimilarWords() def send_querySimilarWords(self, ctx, word, num): self._oprot.writeMessageBegin('querySimilarWords', TMessageType.CALL, self._seqid) args = querySimilarWords_args() args.ctx = ctx args.word = word args.num = num args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_querySimilarWords(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = querySimilarWords_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "querySimilarWords failed: unknown result") def getSimilarity(self, ctx, word1, word2): """ Parameters: - ctx - word1 - word2 """ self.send_getSimilarity(ctx, word1, word2) return self.recv_getSimilarity() def send_getSimilarity(self, ctx, word1, word2): self._oprot.writeMessageBegin('getSimilarity', TMessageType.CALL, self._seqid) args = getSimilarity_args() args.ctx = ctx args.word1 = word1 args.word2 = word2 args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getSimilarity(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getSimilarity_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getSimilarity failed: unknown result") def isDupPoi(self, ctx, vec, category): """ Parameters: - ctx - vec - category """ self.send_isDupPoi(ctx, vec, category) return self.recv_isDupPoi() def send_isDupPoi(self, ctx, vec, category): self._oprot.writeMessageBegin('isDupPoi', TMessageType.CALL, self._seqid) args = isDupPoi_args() args.ctx = ctx args.vec = vec args.category = category args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_isDupPoi(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = isDupPoi_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "isDupPoi failed: unknown result") def musicDssmEmbedding(self, ctx, imgUrl, topK): """ Parameters: - ctx - imgUrl - topK """ self.send_musicDssmEmbedding(ctx, imgUrl, topK) return self.recv_musicDssmEmbedding() def send_musicDssmEmbedding(self, ctx, imgUrl, topK): self._oprot.writeMessageBegin('musicDssmEmbedding', TMessageType.CALL, self._seqid) args = musicDssmEmbedding_args() args.ctx = ctx args.imgUrl = imgUrl args.topK = topK args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_musicDssmEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = musicDssmEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "musicDssmEmbedding failed: unknown result") def getImageClassification(self, ctx, imgUrl, modelType): """ Parameters: - ctx - imgUrl - modelType """ self.send_getImageClassification(ctx, imgUrl, modelType) return self.recv_getImageClassification() def send_getImageClassification(self, ctx, imgUrl, modelType): self._oprot.writeMessageBegin('getImageClassification', TMessageType.CALL, self._seqid) args = getImageClassification_args() args.ctx = ctx args.imgUrl = imgUrl args.modelType = modelType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getImageClassification(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getImageClassification_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getImageClassification failed: unknown result") def isDupSpvV1(self, ctx, leftName, rightName, featureStr): """ Parameters: - ctx - leftName - rightName - featureStr """ self.send_isDupSpvV1(ctx, leftName, rightName, featureStr) return self.recv_isDupSpvV1() def send_isDupSpvV1(self, ctx, leftName, rightName, featureStr): self._oprot.writeMessageBegin('isDupSpvV1', TMessageType.CALL, self._seqid) args = isDupSpvV1_args() args.ctx = ctx args.leftName = leftName args.rightName = rightName args.featureStr = featureStr args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_isDupSpvV1(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = isDupSpvV1_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "isDupSpvV1 failed: unknown result") def sentimentAnalysis(self, ctx, text): """ Parameters: - ctx - text """ self.send_sentimentAnalysis(ctx, text) return self.recv_sentimentAnalysis() def send_sentimentAnalysis(self, ctx, text): self._oprot.writeMessageBegin('sentimentAnalysis', TMessageType.CALL, self._seqid) args = sentimentAnalysis_args() args.ctx = ctx args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sentimentAnalysis(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sentimentAnalysis_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "sentimentAnalysis failed: unknown result") def topicDssmEmbedding(self, ctx, title, content, imgUrl): """ Parameters: - ctx - title - content - imgUrl """ self.send_topicDssmEmbedding(ctx, title, content, imgUrl) return self.recv_topicDssmEmbedding() def send_topicDssmEmbedding(self, ctx, title, content, imgUrl): self._oprot.writeMessageBegin('topicDssmEmbedding', TMessageType.CALL, self._seqid) args = topicDssmEmbedding_args() args.ctx = ctx args.title = title args.content = content args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_topicDssmEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = topicDssmEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "topicDssmEmbedding failed: unknown result") def splitSentence(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_splitSentence(ctx, texts) return self.recv_splitSentence() def send_splitSentence(self, ctx, texts): self._oprot.writeMessageBegin('splitSentence', TMessageType.CALL, self._seqid) args = splitSentence_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_splitSentence(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = splitSentence_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "splitSentence failed: unknown result") def universalNer(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_universalNer(ctx, texts) return self.recv_universalNer() def send_universalNer(self, ctx, texts): self._oprot.writeMessageBegin('universalNer', TMessageType.CALL, self._seqid) args = universalNer_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_universalNer(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = universalNer_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "universalNer failed: unknown result") def universalNerV2(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_universalNerV2(ctx, texts) return self.recv_universalNerV2() def send_universalNerV2(self, ctx, texts): self._oprot.writeMessageBegin('universalNerV2', TMessageType.CALL, self._seqid) args = universalNerV2_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_universalNerV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = universalNerV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "universalNerV2 failed: unknown result") def universalNerV3(self, ctx, texts, types): """ Parameters: - ctx - texts - types """ self.send_universalNerV3(ctx, texts, types) return self.recv_universalNerV3() def send_universalNerV3(self, ctx, texts, types): self._oprot.writeMessageBegin('universalNerV3', TMessageType.CALL, self._seqid) args = universalNerV3_args() args.ctx = ctx args.texts = texts args.types = types args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_universalNerV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = universalNerV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "universalNerV3 failed: unknown result") def brandClassify(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_brandClassify(ctx, texts) return self.recv_brandClassify() def send_brandClassify(self, ctx, texts): self._oprot.writeMessageBegin('brandClassify', TMessageType.CALL, self._seqid) args = brandClassify_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_brandClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = brandClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "brandClassify failed: unknown result") def brandClassifyV2(self, ctx, brandNames, title, content): """ Parameters: - ctx - brandNames - title - content """ self.send_brandClassifyV2(ctx, brandNames, title, content) return self.recv_brandClassifyV2() def send_brandClassifyV2(self, ctx, brandNames, title, content): self._oprot.writeMessageBegin('brandClassifyV2', TMessageType.CALL, self._seqid) args = brandClassifyV2_args() args.ctx = ctx args.brandNames = brandNames args.title = title args.content = content args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_brandClassifyV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = brandClassifyV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "brandClassifyV2 failed: unknown result") def timeSensitiveClassify(self, ctx, title, content): """ Parameters: - ctx - title - content """ self.send_timeSensitiveClassify(ctx, title, content) return self.recv_timeSensitiveClassify() def send_timeSensitiveClassify(self, ctx, title, content): self._oprot.writeMessageBegin('timeSensitiveClassify', TMessageType.CALL, self._seqid) args = timeSensitiveClassify_args() args.ctx = ctx args.title = title args.content = content args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_timeSensitiveClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = timeSensitiveClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "timeSensitiveClassify failed: unknown result") def whiteBoxCartoonize(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_whiteBoxCartoonize(ctx, imgUrl) return self.recv_whiteBoxCartoonize() def send_whiteBoxCartoonize(self, ctx, imgUrl): self._oprot.writeMessageBegin('whiteBoxCartoonize', TMessageType.CALL, self._seqid) args = whiteBoxCartoonize_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_whiteBoxCartoonize(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = whiteBoxCartoonize_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "whiteBoxCartoonize failed: unknown result") def superResolution(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_superResolution(ctx, imgUrl) return self.recv_superResolution() def send_superResolution(self, ctx, imgUrl): self._oprot.writeMessageBegin('superResolution', TMessageType.CALL, self._seqid) args = superResolution_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_superResolution(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = superResolution_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "superResolution failed: unknown result") def noteEcology(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteEcology(ctx, request) return self.recv_noteEcology() def send_noteEcology(self, ctx, request): self._oprot.writeMessageBegin('noteEcology', TMessageType.CALL, self._seqid) args = noteEcology_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteEcology(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteEcology_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteEcology failed: unknown result") def noteQuality(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteQuality(ctx, request) return self.recv_noteQuality() def send_noteQuality(self, ctx, request): self._oprot.writeMessageBegin('noteQuality', TMessageType.CALL, self._seqid) args = noteQuality_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteQuality(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteQuality_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteQuality failed: unknown result") def noteQualityV5(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteQualityV5(ctx, request) return self.recv_noteQualityV5() def send_noteQualityV5(self, ctx, request): self._oprot.writeMessageBegin('noteQualityV5', TMessageType.CALL, self._seqid) args = noteQualityV5_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteQualityV5(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteQualityV5_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteQualityV5 failed: unknown result") def petDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_petDetection(ctx, imgUrl) return self.recv_petDetection() def send_petDetection(self, ctx, imgUrl): self._oprot.writeMessageBegin('petDetection', TMessageType.CALL, self._seqid) args = petDetection_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_petDetection(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = petDetection_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "petDetection failed: unknown result") def tagCorrelation(self, ctx, request): """ Parameters: - ctx - request """ self.send_tagCorrelation(ctx, request) return self.recv_tagCorrelation() def send_tagCorrelation(self, ctx, request): self._oprot.writeMessageBegin('tagCorrelation', TMessageType.CALL, self._seqid) args = tagCorrelation_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_tagCorrelation(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = tagCorrelation_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "tagCorrelation failed: unknown result") def tagCorrelationV2(self, ctx, request): """ Parameters: - ctx - request """ self.send_tagCorrelationV2(ctx, request) return self.recv_tagCorrelationV2() def send_tagCorrelationV2(self, ctx, request): self._oprot.writeMessageBegin('tagCorrelationV2', TMessageType.CALL, self._seqid) args = tagCorrelationV2_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_tagCorrelationV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = tagCorrelationV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "tagCorrelationV2 failed: unknown result") def searchDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_searchDetection(ctx, imgUrl) return self.recv_searchDetection() def send_searchDetection(self, ctx, imgUrl): self._oprot.writeMessageBegin('searchDetection', TMessageType.CALL, self._seqid) args = searchDetection_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchDetection(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchDetection_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchDetection failed: unknown result") def searchOfflineDetection(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_searchOfflineDetection(ctx, imgUrl) return self.recv_searchOfflineDetection() def send_searchOfflineDetection(self, ctx, imgUrl): self._oprot.writeMessageBegin('searchOfflineDetection', TMessageType.CALL, self._seqid) args = searchOfflineDetection_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchOfflineDetection(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchOfflineDetection_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchOfflineDetection failed: unknown result") def searchEmbedding(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ self.send_searchEmbedding(ctx, imgUrl, box) return self.recv_searchEmbedding() def send_searchEmbedding(self, ctx, imgUrl, box): self._oprot.writeMessageBegin('searchEmbedding', TMessageType.CALL, self._seqid) args = searchEmbedding_args() args.ctx = ctx args.imgUrl = imgUrl args.box = box args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchEmbedding failed: unknown result") def searchClassification(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ self.send_searchClassification(ctx, imgUrl, box) return self.recv_searchClassification() def send_searchClassification(self, ctx, imgUrl, box): self._oprot.writeMessageBegin('searchClassification', TMessageType.CALL, self._seqid) args = searchClassification_args() args.ctx = ctx args.imgUrl = imgUrl args.box = box args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchClassification(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchClassification_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchClassification failed: unknown result") def searchClassificationOffline(self, ctx, imgUrl, box): """ Parameters: - ctx - imgUrl - box """ self.send_searchClassificationOffline(ctx, imgUrl, box) return self.recv_searchClassificationOffline() def send_searchClassificationOffline(self, ctx, imgUrl, box): self._oprot.writeMessageBegin('searchClassificationOffline', TMessageType.CALL, self._seqid) args = searchClassificationOffline_args() args.ctx = ctx args.imgUrl = imgUrl args.box = box args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchClassificationOffline(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchClassificationOffline_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchClassificationOffline failed: unknown result") def searchPipeline(self, ctx, imgUrl, useClassification): """ Parameters: - ctx - imgUrl - useClassification """ self.send_searchPipeline(ctx, imgUrl, useClassification) return self.recv_searchPipeline() def send_searchPipeline(self, ctx, imgUrl, useClassification): self._oprot.writeMessageBegin('searchPipeline', TMessageType.CALL, self._seqid) args = searchPipeline_args() args.ctx = ctx args.imgUrl = imgUrl args.useClassification = useClassification args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchPipeline(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchPipeline_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchPipeline failed: unknown result") def searchOfflinePipeline(self, ctx, imgUrl, useClassification): """ Parameters: - ctx - imgUrl - useClassification """ self.send_searchOfflinePipeline(ctx, imgUrl, useClassification) return self.recv_searchOfflinePipeline() def send_searchOfflinePipeline(self, ctx, imgUrl, useClassification): self._oprot.writeMessageBegin('searchOfflinePipeline', TMessageType.CALL, self._seqid) args = searchOfflinePipeline_args() args.ctx = ctx args.imgUrl = imgUrl args.useClassification = useClassification args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchOfflinePipeline(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchOfflinePipeline_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchOfflinePipeline failed: unknown result") def searchRedCloudPipeline(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_searchRedCloudPipeline(ctx, imgUrl) return self.recv_searchRedCloudPipeline() def send_searchRedCloudPipeline(self, ctx, imgUrl): self._oprot.writeMessageBegin('searchRedCloudPipeline', TMessageType.CALL, self._seqid) args = searchRedCloudPipeline_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchRedCloudPipeline(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchRedCloudPipeline_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchRedCloudPipeline failed: unknown result") def searchGisRedCloudPipeline(self, ctx, imgUrl): """ Parameters: - ctx - imgUrl """ self.send_searchGisRedCloudPipeline(ctx, imgUrl) return self.recv_searchGisRedCloudPipeline() def send_searchGisRedCloudPipeline(self, ctx, imgUrl): self._oprot.writeMessageBegin('searchGisRedCloudPipeline', TMessageType.CALL, self._seqid) args = searchGisRedCloudPipeline_args() args.ctx = ctx args.imgUrl = imgUrl args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_searchGisRedCloudPipeline(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = searchGisRedCloudPipeline_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "searchGisRedCloudPipeline failed: unknown result") def noteStructure(self, ctx, cate, text): """ Parameters: - ctx - cate - text """ self.send_noteStructure(ctx, cate, text) return self.recv_noteStructure() def send_noteStructure(self, ctx, cate, text): self._oprot.writeMessageBegin('noteStructure', TMessageType.CALL, self._seqid) args = noteStructure_args() args.ctx = ctx args.cate = cate args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteStructure(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteStructure_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteStructure failed: unknown result") def baikeEntityLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_baikeEntityLink(ctx, noteId, mention, context, candidate, mentionType) return self.recv_baikeEntityLink() def send_baikeEntityLink(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('baikeEntityLink', TMessageType.CALL, self._seqid) args = baikeEntityLink_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_baikeEntityLink(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = baikeEntityLink_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "baikeEntityLink failed: unknown result") def baikeEntityLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_baikeEntityLinkWiper(ctx, noteId, mention, context, candidate, mentionType) return self.recv_baikeEntityLinkWiper() def send_baikeEntityLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('baikeEntityLinkWiper', TMessageType.CALL, self._seqid) args = baikeEntityLinkWiper_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_baikeEntityLinkWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = baikeEntityLinkWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "baikeEntityLinkWiper failed: unknown result") def poiLinkRank(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_poiLinkRank(ctx, noteId, mention, context, candidate, mentionType) return self.recv_poiLinkRank() def send_poiLinkRank(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('poiLinkRank', TMessageType.CALL, self._seqid) args = poiLinkRank_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_poiLinkRank(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = poiLinkRank_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "poiLinkRank failed: unknown result") def noteCategoryLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_noteCategoryLink(ctx, noteId, mention, context, candidate, mentionType) return self.recv_noteCategoryLink() def send_noteCategoryLink(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('noteCategoryLink', TMessageType.CALL, self._seqid) args = noteCategoryLink_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteCategoryLink(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteCategoryLink_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteCategoryLink failed: unknown result") def goodsSpuLink(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_goodsSpuLink(ctx, noteId, mention, context, candidate, mentionType) return self.recv_goodsSpuLink() def send_goodsSpuLink(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('goodsSpuLink', TMessageType.CALL, self._seqid) args = goodsSpuLink_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_goodsSpuLink(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = goodsSpuLink_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "goodsSpuLink failed: unknown result") def goodsSpuLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): """ Parameters: - ctx - noteId - mention - context - candidate - mentionType """ self.send_goodsSpuLinkWiper(ctx, noteId, mention, context, candidate, mentionType) return self.recv_goodsSpuLinkWiper() def send_goodsSpuLinkWiper(self, ctx, noteId, mention, context, candidate, mentionType): self._oprot.writeMessageBegin('goodsSpuLinkWiper', TMessageType.CALL, self._seqid) args = goodsSpuLinkWiper_args() args.ctx = ctx args.noteId = noteId args.mention = mention args.context = context args.candidate = candidate args.mentionType = mentionType args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_goodsSpuLinkWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = goodsSpuLinkWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "goodsSpuLinkWiper failed: unknown result") def generalEntityExtract(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ self.send_generalEntityExtract(ctx, note_id, cate, text) return self.recv_generalEntityExtract() def send_generalEntityExtract(self, ctx, note_id, cate, text): self._oprot.writeMessageBegin('generalEntityExtract', TMessageType.CALL, self._seqid) args = generalEntityExtract_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtract(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtract_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtract failed: unknown result") def generalEntityExtractV2(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ self.send_generalEntityExtractV2(ctx, note_id, cate, text) return self.recv_generalEntityExtractV2() def send_generalEntityExtractV2(self, ctx, note_id, cate, text): self._oprot.writeMessageBegin('generalEntityExtractV2', TMessageType.CALL, self._seqid) args = generalEntityExtractV2_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtractV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtractV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtractV2 failed: unknown result") def generalEntityExtractV3(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ self.send_generalEntityExtractV3(ctx, note_id, cate, text) return self.recv_generalEntityExtractV3() def send_generalEntityExtractV3(self, ctx, note_id, cate, text): self._oprot.writeMessageBegin('generalEntityExtractV3', TMessageType.CALL, self._seqid) args = generalEntityExtractV3_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtractV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtractV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtractV3 failed: unknown result") def generalEntityExtractV4(self, ctx, note_id, cate, texts): """ Parameters: - ctx - note_id - cate - texts """ self.send_generalEntityExtractV4(ctx, note_id, cate, texts) return self.recv_generalEntityExtractV4() def send_generalEntityExtractV4(self, ctx, note_id, cate, texts): self._oprot.writeMessageBegin('generalEntityExtractV4', TMessageType.CALL, self._seqid) args = generalEntityExtractV4_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtractV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtractV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtractV4 failed: unknown result") def generalEntityExtractV4Wiper(self, ctx, note_id, cate, texts): """ Parameters: - ctx - note_id - cate - texts """ self.send_generalEntityExtractV4Wiper(ctx, note_id, cate, texts) return self.recv_generalEntityExtractV4Wiper() def send_generalEntityExtractV4Wiper(self, ctx, note_id, cate, texts): self._oprot.writeMessageBegin('generalEntityExtractV4Wiper', TMessageType.CALL, self._seqid) args = generalEntityExtractV4Wiper_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtractV4Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtractV4Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtractV4Wiper failed: unknown result") def generalEntityClassifyV4(self, ctx, note_id, cate, entities, entityFeature): """ Parameters: - ctx - note_id - cate - entities - entityFeature """ self.send_generalEntityClassifyV4(ctx, note_id, cate, entities, entityFeature) return self.recv_generalEntityClassifyV4() def send_generalEntityClassifyV4(self, ctx, note_id, cate, entities, entityFeature): self._oprot.writeMessageBegin('generalEntityClassifyV4', TMessageType.CALL, self._seqid) args = generalEntityClassifyV4_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.entities = entities args.entityFeature = entityFeature args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityClassifyV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityClassifyV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityClassifyV4 failed: unknown result") def generalEntityClassifyV4Wiper(self, ctx, note_id, cate, entities, entityFeature): """ Parameters: - ctx - note_id - cate - entities - entityFeature """ self.send_generalEntityClassifyV4Wiper(ctx, note_id, cate, entities, entityFeature) return self.recv_generalEntityClassifyV4Wiper() def send_generalEntityClassifyV4Wiper(self, ctx, note_id, cate, entities, entityFeature): self._oprot.writeMessageBegin('generalEntityClassifyV4Wiper', TMessageType.CALL, self._seqid) args = generalEntityClassifyV4Wiper_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.entities = entities args.entityFeature = entityFeature args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityClassifyV4Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityClassifyV4Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityClassifyV4Wiper failed: unknown result") def generalEntityRelationV4(self, ctx, note_id, cate, text, entities): """ Parameters: - ctx - note_id - cate - text - entities """ self.send_generalEntityRelationV4(ctx, note_id, cate, text, entities) return self.recv_generalEntityRelationV4() def send_generalEntityRelationV4(self, ctx, note_id, cate, text, entities): self._oprot.writeMessageBegin('generalEntityRelationV4', TMessageType.CALL, self._seqid) args = generalEntityRelationV4_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.entities = entities args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityRelationV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityRelationV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityRelationV4 failed: unknown result") def generalEntityRelationV4Wiper(self, ctx, note_id, cate, text, entities): """ Parameters: - ctx - note_id - cate - text - entities """ self.send_generalEntityRelationV4Wiper(ctx, note_id, cate, text, entities) return self.recv_generalEntityRelationV4Wiper() def send_generalEntityRelationV4Wiper(self, ctx, note_id, cate, text, entities): self._oprot.writeMessageBegin('generalEntityRelationV4Wiper', TMessageType.CALL, self._seqid) args = generalEntityRelationV4Wiper_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.entities = entities args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityRelationV4Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityRelationV4Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityRelationV4Wiper failed: unknown result") def generalEntityExtractWiper(self, ctx, note_id, cate, text): """ Parameters: - ctx - note_id - cate - text """ self.send_generalEntityExtractWiper(ctx, note_id, cate, text) return self.recv_generalEntityExtractWiper() def send_generalEntityExtractWiper(self, ctx, note_id, cate, text): self._oprot.writeMessageBegin('generalEntityExtractWiper', TMessageType.CALL, self._seqid) args = generalEntityExtractWiper_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_generalEntityExtractWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = generalEntityExtractWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generalEntityExtractWiper failed: unknown result") def importanceScore(self, ctx, note_id, cate, text, entity_rst, usr_tag): """ Parameters: - ctx - note_id - cate - text - entity_rst - usr_tag """ self.send_importanceScore(ctx, note_id, cate, text, entity_rst, usr_tag) return self.recv_importanceScore() def send_importanceScore(self, ctx, note_id, cate, text, entity_rst, usr_tag): self._oprot.writeMessageBegin('importanceScore', TMessageType.CALL, self._seqid) args = importanceScore_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.entity_rst = entity_rst args.usr_tag = usr_tag args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScore(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScore_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScore failed: unknown result") def importanceWiper(self, ctx, note_id, cate, text, entity_rst, usr_tag): """ Parameters: - ctx - note_id - cate - text - entity_rst - usr_tag """ self.send_importanceWiper(ctx, note_id, cate, text, entity_rst, usr_tag) return self.recv_importanceWiper() def send_importanceWiper(self, ctx, note_id, cate, text, entity_rst, usr_tag): self._oprot.writeMessageBegin('importanceWiper', TMessageType.CALL, self._seqid) args = importanceWiper_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.entity_rst = entity_rst args.usr_tag = usr_tag args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceWiper failed: unknown result") def importanceScoreV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ self.send_importanceScoreV3(ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic) return self.recv_importanceScoreV3() def send_importanceScoreV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): self._oprot.writeMessageBegin('importanceScoreV3', TMessageType.CALL, self._seqid) args = importanceScoreV3_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.note_entities = note_entities args.standard_entities = standard_entities args.usr_tag = usr_tag args.note_title = note_title args.note_topic = note_topic args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScoreV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScoreV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScoreV3 failed: unknown result") def importanceWiperV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ self.send_importanceWiperV3(ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic) return self.recv_importanceWiperV3() def send_importanceWiperV3(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): self._oprot.writeMessageBegin('importanceWiperV3', TMessageType.CALL, self._seqid) args = importanceWiperV3_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.note_entities = note_entities args.standard_entities = standard_entities args.usr_tag = usr_tag args.note_title = note_title args.note_topic = note_topic args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceWiperV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceWiperV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceWiperV3 failed: unknown result") def importanceScoreV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ self.send_importanceScoreV4(ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic) return self.recv_importanceScoreV4() def send_importanceScoreV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): self._oprot.writeMessageBegin('importanceScoreV4', TMessageType.CALL, self._seqid) args = importanceScoreV4_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.note_entities = note_entities args.standard_entities = standard_entities args.usr_tag = usr_tag args.note_title = note_title args.note_topic = note_topic args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScoreV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScoreV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScoreV4 failed: unknown result") def importanceScoreV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ self.send_importanceScoreV5(ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task) return self.recv_importanceScoreV5() def send_importanceScoreV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): self._oprot.writeMessageBegin('importanceScoreV5', TMessageType.CALL, self._seqid) args = importanceScoreV5_args() args.ctx = ctx args.note_id = note_id args.predict_note_entities = predict_note_entities args.note_entities = note_entities args.taxonomy = taxonomy args.note_title = note_title args.usr_tag = usr_tag args.note_content = note_content args.ocr = ocr args.note_type = note_type args.images = images args.videoframes = videoframes args.task = task args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScoreV5(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScoreV5_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScoreV5 failed: unknown result") def importanceWiperV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ self.send_importanceWiperV5(ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task) return self.recv_importanceWiperV5() def send_importanceWiperV5(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): self._oprot.writeMessageBegin('importanceWiperV5', TMessageType.CALL, self._seqid) args = importanceWiperV5_args() args.ctx = ctx args.note_id = note_id args.predict_note_entities = predict_note_entities args.note_entities = note_entities args.taxonomy = taxonomy args.note_title = note_title args.usr_tag = usr_tag args.note_content = note_content args.ocr = ocr args.note_type = note_type args.images = images args.videoframes = videoframes args.task = task args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceWiperV5(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceWiperV5_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceWiperV5 failed: unknown result") def importanceScoreV5Test(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): """ Parameters: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ self.send_importanceScoreV5Test(ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task) return self.recv_importanceScoreV5Test() def send_importanceScoreV5Test(self, ctx, note_id, predict_note_entities, note_entities, taxonomy, note_title, usr_tag, note_content, ocr, note_type, images, videoframes, task): self._oprot.writeMessageBegin('importanceScoreV5Test', TMessageType.CALL, self._seqid) args = importanceScoreV5Test_args() args.ctx = ctx args.note_id = note_id args.predict_note_entities = predict_note_entities args.note_entities = note_entities args.taxonomy = taxonomy args.note_title = note_title args.usr_tag = usr_tag args.note_content = note_content args.ocr = ocr args.note_type = note_type args.images = images args.videoframes = videoframes args.task = task args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScoreV5Test(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScoreV5Test_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScoreV5Test failed: unknown result") def importanceWiperV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ self.send_importanceWiperV4(ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic) return self.recv_importanceWiperV4() def send_importanceWiperV4(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): self._oprot.writeMessageBegin('importanceWiperV4', TMessageType.CALL, self._seqid) args = importanceWiperV4_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.note_entities = note_entities args.standard_entities = standard_entities args.usr_tag = usr_tag args.note_title = note_title args.note_topic = note_topic args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceWiperV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceWiperV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceWiperV4 failed: unknown result") def importanceScoreV4Test(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): """ Parameters: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ self.send_importanceScoreV4Test(ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic) return self.recv_importanceScoreV4Test() def send_importanceScoreV4Test(self, ctx, note_id, cate, text, note_entities, standard_entities, usr_tag, note_title, note_topic): self._oprot.writeMessageBegin('importanceScoreV4Test', TMessageType.CALL, self._seqid) args = importanceScoreV4Test_args() args.ctx = ctx args.note_id = note_id args.cate = cate args.text = text args.note_entities = note_entities args.standard_entities = standard_entities args.usr_tag = usr_tag args.note_title = note_title args.note_topic = note_topic args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_importanceScoreV4Test(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = importanceScoreV4Test_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "importanceScoreV4Test failed: unknown result") def queryNER(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_queryNER(ctx, texts) return self.recv_queryNER() def send_queryNER(self, ctx, texts): self._oprot.writeMessageBegin('queryNER', TMessageType.CALL, self._seqid) args = queryNER_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryNER(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryNER_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryNER failed: unknown result") def queryNERV2(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_queryNERV2(ctx, texts) return self.recv_queryNERV2() def send_queryNERV2(self, ctx, texts): self._oprot.writeMessageBegin('queryNERV2', TMessageType.CALL, self._seqid) args = queryNERV2_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryNERV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryNERV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryNERV2 failed: unknown result") def queryNERV3(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_queryNERV3(ctx, texts) return self.recv_queryNERV3() def send_queryNERV3(self, ctx, texts): self._oprot.writeMessageBegin('queryNERV3', TMessageType.CALL, self._seqid) args = queryNERV3_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryNERV3(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryNERV3_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryNERV3 failed: unknown result") def queryNERV4(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_queryNERV4(ctx, texts) return self.recv_queryNERV4() def send_queryNERV4(self, ctx, texts): self._oprot.writeMessageBegin('queryNERV4', TMessageType.CALL, self._seqid) args = queryNERV4_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryNERV4(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryNERV4_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryNERV4 failed: unknown result") def sentNER(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_sentNER(ctx, texts) return self.recv_sentNER() def send_sentNER(self, ctx, texts): self._oprot.writeMessageBegin('sentNER', TMessageType.CALL, self._seqid) args = sentNER_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sentNER(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sentNER_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "sentNER failed: unknown result") def sentNERLatest(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_sentNERLatest(ctx, texts) return self.recv_sentNERLatest() def send_sentNERLatest(self, ctx, texts): self._oprot.writeMessageBegin('sentNERLatest', TMessageType.CALL, self._seqid) args = sentNERLatest_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sentNERLatest(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sentNERLatest_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "sentNERLatest failed: unknown result") def noteFeedback(self, ctx, note_id, title, content): """ Parameters: - ctx - note_id - title - content """ self.send_noteFeedback(ctx, note_id, title, content) return self.recv_noteFeedback() def send_noteFeedback(self, ctx, note_id, title, content): self._oprot.writeMessageBegin('noteFeedback', TMessageType.CALL, self._seqid) args = noteFeedback_args() args.ctx = ctx args.note_id = note_id args.title = title args.content = content args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteFeedback(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteFeedback_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteFeedback failed: unknown result") def noteFeedbackV2(self, ctx, note_id, title, content): """ Parameters: - ctx - note_id - title - content """ self.send_noteFeedbackV2(ctx, note_id, title, content) return self.recv_noteFeedbackV2() def send_noteFeedbackV2(self, ctx, note_id, title, content): self._oprot.writeMessageBegin('noteFeedbackV2', TMessageType.CALL, self._seqid) args = noteFeedbackV2_args() args.ctx = ctx args.note_id = note_id args.title = title args.content = content args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteFeedbackV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteFeedbackV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteFeedbackV2 failed: unknown result") def amazingCover(self, ctx, key_frames): """ Parameters: - ctx - key_frames """ self.send_amazingCover(ctx, key_frames) return self.recv_amazingCover() def send_amazingCover(self, ctx, key_frames): self._oprot.writeMessageBegin('amazingCover', TMessageType.CALL, self._seqid) args = amazingCover_args() args.ctx = ctx args.key_frames = key_frames args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_amazingCover(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = amazingCover_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "amazingCover failed: unknown result") def noteEmbedding(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_noteEmbedding(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_noteEmbedding() def send_noteEmbedding(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('noteEmbedding', TMessageType.CALL, self._seqid) args = noteEmbedding_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteEmbedding failed: unknown result") def noteEmbeddingWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): """ Parameters: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ self.send_noteEmbeddingWiper(ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList) return self.recv_noteEmbeddingWiper() def send_noteEmbeddingWiper(self, ctx, noteId, noteType, useCache, topicList, titleList, contentList, imageList, keyFrameList): self._oprot.writeMessageBegin('noteEmbeddingWiper', TMessageType.CALL, self._seqid) args = noteEmbeddingWiper_args() args.ctx = ctx args.noteId = noteId args.noteType = noteType args.useCache = useCache args.topicList = topicList args.titleList = titleList args.contentList = contentList args.imageList = imageList args.keyFrameList = keyFrameList args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteEmbeddingWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteEmbeddingWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteEmbeddingWiper failed: unknown result") def noteInformationClassify(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteInformationClassify(ctx, request) return self.recv_noteInformationClassify() def send_noteInformationClassify(self, ctx, request): self._oprot.writeMessageBegin('noteInformationClassify', TMessageType.CALL, self._seqid) args = noteInformationClassify_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteInformationClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteInformationClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteInformationClassify failed: unknown result") def noteInformationClassifyV2(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteInformationClassifyV2(ctx, request) return self.recv_noteInformationClassifyV2() def send_noteInformationClassifyV2(self, ctx, request): self._oprot.writeMessageBegin('noteInformationClassifyV2', TMessageType.CALL, self._seqid) args = noteInformationClassifyV2_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteInformationClassifyV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteInformationClassifyV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteInformationClassifyV2 failed: unknown result") def noteInformationClassifyV2Wiper(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteInformationClassifyV2Wiper(ctx, request) return self.recv_noteInformationClassifyV2Wiper() def send_noteInformationClassifyV2Wiper(self, ctx, request): self._oprot.writeMessageBegin('noteInformationClassifyV2Wiper', TMessageType.CALL, self._seqid) args = noteInformationClassifyV2Wiper_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteInformationClassifyV2Wiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteInformationClassifyV2Wiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteInformationClassifyV2Wiper failed: unknown result") def noteTimelinessClassify(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteTimelinessClassify(ctx, request) return self.recv_noteTimelinessClassify() def send_noteTimelinessClassify(self, ctx, request): self._oprot.writeMessageBegin('noteTimelinessClassify', TMessageType.CALL, self._seqid) args = noteTimelinessClassify_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteTimelinessClassify(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteTimelinessClassify_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteTimelinessClassify failed: unknown result") def noteTimelinessClassifyWiper(self, ctx, request): """ Parameters: - ctx - request """ self.send_noteTimelinessClassifyWiper(ctx, request) return self.recv_noteTimelinessClassifyWiper() def send_noteTimelinessClassifyWiper(self, ctx, request): self._oprot.writeMessageBegin('noteTimelinessClassifyWiper', TMessageType.CALL, self._seqid) args = noteTimelinessClassifyWiper_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_noteTimelinessClassifyWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = noteTimelinessClassifyWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "noteTimelinessClassifyWiper failed: unknown result") def queryEmbedding(self, ctx, query): """ Parameters: - ctx - query """ self.send_queryEmbedding(ctx, query) return self.recv_queryEmbedding() def send_queryEmbedding(self, ctx, query): self._oprot.writeMessageBegin('queryEmbedding', TMessageType.CALL, self._seqid) args = queryEmbedding_args() args.ctx = ctx args.query = query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryEmbedding(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryEmbedding_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryEmbedding failed: unknown result") def queryEmbeddingV2(self, ctx, query): """ Parameters: - ctx - query """ self.send_queryEmbeddingV2(ctx, query) return self.recv_queryEmbeddingV2() def send_queryEmbeddingV2(self, ctx, query): self._oprot.writeMessageBegin('queryEmbeddingV2', TMessageType.CALL, self._seqid) args = queryEmbeddingV2_args() args.ctx = ctx args.query = query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryEmbeddingV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryEmbeddingV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryEmbeddingV2 failed: unknown result") def queryBatchEmbeddingV2(self, ctx, query): """ Parameters: - ctx - query """ self.send_queryBatchEmbeddingV2(ctx, query) return self.recv_queryBatchEmbeddingV2() def send_queryBatchEmbeddingV2(self, ctx, query): self._oprot.writeMessageBegin('queryBatchEmbeddingV2', TMessageType.CALL, self._seqid) args = queryBatchEmbeddingV2_args() args.ctx = ctx args.query = query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryBatchEmbeddingV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryBatchEmbeddingV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryBatchEmbeddingV2 failed: unknown result") def getLabelCorrelation(self, ctx, request): """ Parameters: - ctx - request """ self.send_getLabelCorrelation(ctx, request) return self.recv_getLabelCorrelation() def send_getLabelCorrelation(self, ctx, request): self._oprot.writeMessageBegin('getLabelCorrelation', TMessageType.CALL, self._seqid) args = getLabelCorrelation_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getLabelCorrelation(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getLabelCorrelation_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getLabelCorrelation failed: unknown result") def getDocGenerateQuery(self, ctx, request): """ Parameters: - ctx - request """ self.send_getDocGenerateQuery(ctx, request) return self.recv_getDocGenerateQuery() def send_getDocGenerateQuery(self, ctx, request): self._oprot.writeMessageBegin('getDocGenerateQuery', TMessageType.CALL, self._seqid) args = getDocGenerateQuery_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getDocGenerateQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getDocGenerateQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getDocGenerateQuery failed: unknown result") def baikeParse(self, ctx, url): """ Parameters: - ctx - url """ self.send_baikeParse(ctx, url) return self.recv_baikeParse() def send_baikeParse(self, ctx, url): self._oprot.writeMessageBegin('baikeParse', TMessageType.CALL, self._seqid) args = baikeParse_args() args.ctx = ctx args.url = url args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_baikeParse(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = baikeParse_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "baikeParse failed: unknown result") def baikeParseWiper(self, ctx, url): """ Parameters: - ctx - url """ self.send_baikeParseWiper(ctx, url) return self.recv_baikeParseWiper() def send_baikeParseWiper(self, ctx, url): self._oprot.writeMessageBegin('baikeParseWiper', TMessageType.CALL, self._seqid) args = baikeParseWiper_args() args.ctx = ctx args.url = url args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_baikeParseWiper(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = baikeParseWiper_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "baikeParseWiper failed: unknown result") def getNoteIntent(self, ctx, request): """ Parameters: - ctx - request """ self.send_getNoteIntent(ctx, request) return self.recv_getNoteIntent() def send_getNoteIntent(self, ctx, request): self._oprot.writeMessageBegin('getNoteIntent', TMessageType.CALL, self._seqid) args = getNoteIntent_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getNoteIntent(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getNoteIntent_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getNoteIntent failed: unknown result") def getQueryGeneralIntent(self, ctx, request): """ Parameters: - ctx - request """ self.send_getQueryGeneralIntent(ctx, request) return self.recv_getQueryGeneralIntent() def send_getQueryGeneralIntent(self, ctx, request): self._oprot.writeMessageBegin('getQueryGeneralIntent', TMessageType.CALL, self._seqid) args = getQueryGeneralIntent_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQueryGeneralIntent(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQueryGeneralIntent_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueryGeneralIntent failed: unknown result") def getQueryGeneralIntentV2(self, ctx, request): """ Parameters: - ctx - request """ self.send_getQueryGeneralIntentV2(ctx, request) return self.recv_getQueryGeneralIntentV2() def send_getQueryGeneralIntentV2(self, ctx, request): self._oprot.writeMessageBegin('getQueryGeneralIntentV2', TMessageType.CALL, self._seqid) args = getQueryGeneralIntentV2_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQueryGeneralIntentV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQueryGeneralIntentV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueryGeneralIntentV2 failed: unknown result") def getQueryQualityV2(self, ctx, request): """ Parameters: - ctx - request """ self.send_getQueryQualityV2(ctx, request) return self.recv_getQueryQualityV2() def send_getQueryQualityV2(self, ctx, request): self._oprot.writeMessageBegin('getQueryQualityV2', TMessageType.CALL, self._seqid) args = getQueryQualityV2_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQueryQualityV2(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQueryQualityV2_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueryQualityV2 failed: unknown result") def getQueryCorrection(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_getQueryCorrection(ctx, texts) return self.recv_getQueryCorrection() def send_getQueryCorrection(self, ctx, texts): self._oprot.writeMessageBegin('getQueryCorrection', TMessageType.CALL, self._seqid) args = getQueryCorrection_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQueryCorrection(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQueryCorrection_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueryCorrection failed: unknown result") def getQualityPPL(self, ctx, texts): """ Parameters: - ctx - texts """ self.send_getQualityPPL(ctx, texts) return self.recv_getQualityPPL() def send_getQualityPPL(self, ctx, texts): self._oprot.writeMessageBegin('getQualityPPL', TMessageType.CALL, self._seqid) args = getQualityPPL_args() args.ctx = ctx args.texts = texts args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQualityPPL(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQualityPPL_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQualityPPL failed: unknown result") def getQuerySynonym(self, ctx, request): """ Parameters: - ctx - request """ self.send_getQuerySynonym(ctx, request) return self.recv_getQuerySynonym() def send_getQuerySynonym(self, ctx, request): self._oprot.writeMessageBegin('getQuerySynonym', TMessageType.CALL, self._seqid) args = getQuerySynonym_args() args.ctx = ctx args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getQuerySynonym(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getQuerySynonym_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQuerySynonym failed: unknown result") def caesarCommonQuery(self, ctx, caesarCommonRequest): """ Parameters: - ctx - caesarCommonRequest """ self.send_caesarCommonQuery(ctx, caesarCommonRequest) return self.recv_caesarCommonQuery() def send_caesarCommonQuery(self, ctx, caesarCommonRequest): self._oprot.writeMessageBegin('caesarCommonQuery', TMessageType.CALL, self._seqid) args = caesarCommonQuery_args() args.ctx = ctx args.caesarCommonRequest = caesarCommonRequest args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_caesarCommonQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = caesarCommonQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "caesarCommonQuery failed: unknown result") class Processor(titancaesar.thrift.caesar.BaseService.Processor, Iface, TProcessor): def __init__(self, handler): titancaesar.thrift.caesar.BaseService.Processor.__init__(self, handler) self._processMap["ping"] = Processor.process_ping self._processMap["newGender"] = Processor.process_newGender self._processMap["genderV2"] = Processor.process_genderV2 self._processMap["LocalizationClassify"] = Processor.process_LocalizationClassify self._processMap["LocalizationClassifyWiper"] = Processor.process_LocalizationClassifyWiper self._processMap["genderV3"] = Processor.process_genderV3 self._processMap["highShow"] = Processor.process_highShow self._processMap["sincere"] = Processor.process_sincere self._processMap["badNote"] = Processor.process_badNote self._processMap["badComment"] = Processor.process_badComment self._processMap["aigoTrain"] = Processor.process_aigoTrain self._processMap["aigoTest"] = Processor.process_aigoTest self._processMap["commentClassify"] = Processor.process_commentClassify self._processMap["commentClassifyV2"] = Processor.process_commentClassifyV2 self._processMap["commentSecurityClassify"] = Processor.process_commentSecurityClassify self._processMap["commentOrderClassify"] = Processor.process_commentOrderClassify self._processMap["commentClassifyTest"] = Processor.process_commentClassifyTest self._processMap["danmuSentiment"] = Processor.process_danmuSentiment self._processMap["danmuSentiment_apple"] = Processor.process_danmuSentiment_apple self._processMap["accusation"] = Processor.process_accusation self._processMap["taxonomy"] = Processor.process_taxonomy self._processMap["taxonomyV2"] = Processor.process_taxonomyV2 self._processMap["taxonomyW2"] = Processor.process_taxonomyW2 self._processMap["audioFinger"] = Processor.process_audioFinger self._processMap["knowledge"] = Processor.process_knowledge self._processMap["noteSecurity"] = Processor.process_noteSecurity self._processMap["advertise"] = Processor.process_advertise self._processMap["giftBox"] = Processor.process_giftBox self._processMap["giftBoxV2"] = Processor.process_giftBoxV2 self._processMap["fashion"] = Processor.process_fashion self._processMap["feedbackClassify"] = Processor.process_feedbackClassify self._processMap["tagClassification"] = Processor.process_tagClassification self._processMap["customerConversationClassify"] = Processor.process_customerConversationClassify self._processMap["customerConversationClassifyV2"] = Processor.process_customerConversationClassifyV2 self._processMap["cover"] = Processor.process_cover self._processMap["uncomfortable"] = Processor.process_uncomfortable self._processMap["aestheticAssessment"] = Processor.process_aestheticAssessment self._processMap["realphoto"] = Processor.process_realphoto self._processMap["ctrEmbedding"] = Processor.process_ctrEmbedding self._processMap["ctrForSearch"] = Processor.process_ctrForSearch self._processMap["suspectUser"] = Processor.process_suspectUser self._processMap["ctrRanking"] = Processor.process_ctrRanking self._processMap["videoTagging"] = Processor.process_videoTagging self._processMap["newTopic"] = Processor.process_newTopic self._processMap["newTopicV2"] = Processor.process_newTopicV2 self._processMap["newConceptionV1"] = Processor.process_newConceptionV1 self._processMap["newTagV3"] = Processor.process_newTagV3 self._processMap["newTopicPostRule"] = Processor.process_newTopicPostRule self._processMap["antiSEOV1"] = Processor.process_antiSEOV1 self._processMap["newTopicWiper"] = Processor.process_newTopicWiper self._processMap["newTopicV2Wiper"] = Processor.process_newTopicV2Wiper self._processMap["newTagV3Wiper"] = Processor.process_newTagV3Wiper self._processMap["cdn2redkvWiper"] = Processor.process_cdn2redkvWiper self._processMap["videoEmbedding"] = Processor.process_videoEmbedding self._processMap["normalEmbedding"] = Processor.process_normalEmbedding self._processMap["commentInsult"] = Processor.process_commentInsult self._processMap["dishNer"] = Processor.process_dishNer self._processMap["detect"] = Processor.process_detect self._processMap["faceRecognition"] = Processor.process_faceRecognition self._processMap["querySimilarWords"] = Processor.process_querySimilarWords self._processMap["getSimilarity"] = Processor.process_getSimilarity self._processMap["isDupPoi"] = Processor.process_isDupPoi self._processMap["musicDssmEmbedding"] = Processor.process_musicDssmEmbedding self._processMap["getImageClassification"] = Processor.process_getImageClassification self._processMap["isDupSpvV1"] = Processor.process_isDupSpvV1 self._processMap["sentimentAnalysis"] = Processor.process_sentimentAnalysis self._processMap["topicDssmEmbedding"] = Processor.process_topicDssmEmbedding self._processMap["splitSentence"] = Processor.process_splitSentence self._processMap["universalNer"] = Processor.process_universalNer self._processMap["universalNerV2"] = Processor.process_universalNerV2 self._processMap["universalNerV3"] = Processor.process_universalNerV3 self._processMap["brandClassify"] = Processor.process_brandClassify self._processMap["brandClassifyV2"] = Processor.process_brandClassifyV2 self._processMap["timeSensitiveClassify"] = Processor.process_timeSensitiveClassify self._processMap["whiteBoxCartoonize"] = Processor.process_whiteBoxCartoonize self._processMap["superResolution"] = Processor.process_superResolution self._processMap["noteEcology"] = Processor.process_noteEcology self._processMap["noteQuality"] = Processor.process_noteQuality self._processMap["noteQualityV5"] = Processor.process_noteQualityV5 self._processMap["petDetection"] = Processor.process_petDetection self._processMap["tagCorrelation"] = Processor.process_tagCorrelation self._processMap["tagCorrelationV2"] = Processor.process_tagCorrelationV2 self._processMap["searchDetection"] = Processor.process_searchDetection self._processMap["searchOfflineDetection"] = Processor.process_searchOfflineDetection self._processMap["searchEmbedding"] = Processor.process_searchEmbedding self._processMap["searchClassification"] = Processor.process_searchClassification self._processMap["searchClassificationOffline"] = Processor.process_searchClassificationOffline self._processMap["searchPipeline"] = Processor.process_searchPipeline self._processMap["searchOfflinePipeline"] = Processor.process_searchOfflinePipeline self._processMap["searchRedCloudPipeline"] = Processor.process_searchRedCloudPipeline self._processMap["searchGisRedCloudPipeline"] = Processor.process_searchGisRedCloudPipeline self._processMap["noteStructure"] = Processor.process_noteStructure self._processMap["baikeEntityLink"] = Processor.process_baikeEntityLink self._processMap["baikeEntityLinkWiper"] = Processor.process_baikeEntityLinkWiper self._processMap["poiLinkRank"] = Processor.process_poiLinkRank self._processMap["noteCategoryLink"] = Processor.process_noteCategoryLink self._processMap["goodsSpuLink"] = Processor.process_goodsSpuLink self._processMap["goodsSpuLinkWiper"] = Processor.process_goodsSpuLinkWiper self._processMap["generalEntityExtract"] = Processor.process_generalEntityExtract self._processMap["generalEntityExtractV2"] = Processor.process_generalEntityExtractV2 self._processMap["generalEntityExtractV3"] = Processor.process_generalEntityExtractV3 self._processMap["generalEntityExtractV4"] = Processor.process_generalEntityExtractV4 self._processMap["generalEntityExtractV4Wiper"] = Processor.process_generalEntityExtractV4Wiper self._processMap["generalEntityClassifyV4"] = Processor.process_generalEntityClassifyV4 self._processMap["generalEntityClassifyV4Wiper"] = Processor.process_generalEntityClassifyV4Wiper self._processMap["generalEntityRelationV4"] = Processor.process_generalEntityRelationV4 self._processMap["generalEntityRelationV4Wiper"] = Processor.process_generalEntityRelationV4Wiper self._processMap["generalEntityExtractWiper"] = Processor.process_generalEntityExtractWiper self._processMap["importanceScore"] = Processor.process_importanceScore self._processMap["importanceWiper"] = Processor.process_importanceWiper self._processMap["importanceScoreV3"] = Processor.process_importanceScoreV3 self._processMap["importanceWiperV3"] = Processor.process_importanceWiperV3 self._processMap["importanceScoreV4"] = Processor.process_importanceScoreV4 self._processMap["importanceScoreV5"] = Processor.process_importanceScoreV5 self._processMap["importanceWiperV5"] = Processor.process_importanceWiperV5 self._processMap["importanceScoreV5Test"] = Processor.process_importanceScoreV5Test self._processMap["importanceWiperV4"] = Processor.process_importanceWiperV4 self._processMap["importanceScoreV4Test"] = Processor.process_importanceScoreV4Test self._processMap["queryNER"] = Processor.process_queryNER self._processMap["queryNERV2"] = Processor.process_queryNERV2 self._processMap["queryNERV3"] = Processor.process_queryNERV3 self._processMap["queryNERV4"] = Processor.process_queryNERV4 self._processMap["sentNER"] = Processor.process_sentNER self._processMap["sentNERLatest"] = Processor.process_sentNERLatest self._processMap["noteFeedback"] = Processor.process_noteFeedback self._processMap["noteFeedbackV2"] = Processor.process_noteFeedbackV2 self._processMap["amazingCover"] = Processor.process_amazingCover self._processMap["noteEmbedding"] = Processor.process_noteEmbedding self._processMap["noteEmbeddingWiper"] = Processor.process_noteEmbeddingWiper self._processMap["noteInformationClassify"] = Processor.process_noteInformationClassify self._processMap["noteInformationClassifyV2"] = Processor.process_noteInformationClassifyV2 self._processMap["noteInformationClassifyV2Wiper"] = Processor.process_noteInformationClassifyV2Wiper self._processMap["noteTimelinessClassify"] = Processor.process_noteTimelinessClassify self._processMap["noteTimelinessClassifyWiper"] = Processor.process_noteTimelinessClassifyWiper self._processMap["queryEmbedding"] = Processor.process_queryEmbedding self._processMap["queryEmbeddingV2"] = Processor.process_queryEmbeddingV2 self._processMap["queryBatchEmbeddingV2"] = Processor.process_queryBatchEmbeddingV2 self._processMap["getLabelCorrelation"] = Processor.process_getLabelCorrelation self._processMap["getDocGenerateQuery"] = Processor.process_getDocGenerateQuery self._processMap["baikeParse"] = Processor.process_baikeParse self._processMap["baikeParseWiper"] = Processor.process_baikeParseWiper self._processMap["getNoteIntent"] = Processor.process_getNoteIntent self._processMap["getQueryGeneralIntent"] = Processor.process_getQueryGeneralIntent self._processMap["getQueryGeneralIntentV2"] = Processor.process_getQueryGeneralIntentV2 self._processMap["getQueryQualityV2"] = Processor.process_getQueryQualityV2 self._processMap["getQueryCorrection"] = Processor.process_getQueryCorrection self._processMap["getQualityPPL"] = Processor.process_getQualityPPL self._processMap["getQuerySynonym"] = Processor.process_getQuerySynonym self._processMap["caesarCommonQuery"] = Processor.process_caesarCommonQuery def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newGender(self, seqid, iprot, oprot): args = newGender_args() args.read(iprot) iprot.readMessageEnd() result = newGender_result() try: result.success = self._handler.newGender(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newGender", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_genderV2(self, seqid, iprot, oprot): args = genderV2_args() args.read(iprot) iprot.readMessageEnd() result = genderV2_result() try: result.success = self._handler.genderV2(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("genderV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_LocalizationClassify(self, seqid, iprot, oprot): args = LocalizationClassify_args() args.read(iprot) iprot.readMessageEnd() result = LocalizationClassify_result() try: result.success = self._handler.LocalizationClassify(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("LocalizationClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_LocalizationClassifyWiper(self, seqid, iprot, oprot): args = LocalizationClassifyWiper_args() args.read(iprot) iprot.readMessageEnd() result = LocalizationClassifyWiper_result() try: result.success = self._handler.LocalizationClassifyWiper(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("LocalizationClassifyWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_genderV3(self, seqid, iprot, oprot): args = genderV3_args() args.read(iprot) iprot.readMessageEnd() result = genderV3_result() try: result.success = self._handler.genderV3(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("genderV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_highShow(self, seqid, iprot, oprot): args = highShow_args() args.read(iprot) iprot.readMessageEnd() result = highShow_result() try: result.success = self._handler.highShow(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("highShow", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sincere(self, seqid, iprot, oprot): args = sincere_args() args.read(iprot) iprot.readMessageEnd() result = sincere_result() try: result.success = self._handler.sincere(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sincere", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_badNote(self, seqid, iprot, oprot): args = badNote_args() args.read(iprot) iprot.readMessageEnd() result = badNote_result() try: result.success = self._handler.badNote(args.ctx, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("badNote", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_badComment(self, seqid, iprot, oprot): args = badComment_args() args.read(iprot) iprot.readMessageEnd() result = badComment_result() try: result.success = self._handler.badComment(args.ctx, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("badComment", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_aigoTrain(self, seqid, iprot, oprot): args = aigoTrain_args() args.read(iprot) iprot.readMessageEnd() result = aigoTrain_result() try: result.success = self._handler.aigoTrain(args.ctx, args.datasetPath, args.modelType, args.projectId, args.modelVersion, args.config) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("aigoTrain", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_aigoTest(self, seqid, iprot, oprot): args = aigoTest_args() args.read(iprot) iprot.readMessageEnd() result = aigoTest_result() try: result.success = self._handler.aigoTest(args.ctx, args.materials, args.modelType, args.modelPath) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("aigoTest", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentClassify(self, seqid, iprot, oprot): args = commentClassify_args() args.read(iprot) iprot.readMessageEnd() result = commentClassify_result() try: result.success = self._handler.commentClassify(args.ctx, args.text, args.sameAuthor, args.contextText) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentClassifyV2(self, seqid, iprot, oprot): args = commentClassifyV2_args() args.read(iprot) iprot.readMessageEnd() result = commentClassifyV2_result() try: result.success = self._handler.commentClassifyV2(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentClassifyV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentSecurityClassify(self, seqid, iprot, oprot): args = commentSecurityClassify_args() args.read(iprot) iprot.readMessageEnd() result = commentSecurityClassify_result() try: result.success = self._handler.commentSecurityClassify(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentSecurityClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentOrderClassify(self, seqid, iprot, oprot): args = commentOrderClassify_args() args.read(iprot) iprot.readMessageEnd() result = commentOrderClassify_result() try: result.success = self._handler.commentOrderClassify(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentOrderClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentClassifyTest(self, seqid, iprot, oprot): args = commentClassifyTest_args() args.read(iprot) iprot.readMessageEnd() result = commentClassifyTest_result() try: result.success = self._handler.commentClassifyTest(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentClassifyTest", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_danmuSentiment(self, seqid, iprot, oprot): args = danmuSentiment_args() args.read(iprot) iprot.readMessageEnd() result = danmuSentiment_result() try: result.success = self._handler.danmuSentiment(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("danmuSentiment", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_danmuSentiment_apple(self, seqid, iprot, oprot): args = danmuSentiment_apple_args() args.read(iprot) iprot.readMessageEnd() result = danmuSentiment_apple_result() try: result.success = self._handler.danmuSentiment_apple(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("danmuSentiment_apple", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_accusation(self, seqid, iprot, oprot): args = accusation_args() args.read(iprot) iprot.readMessageEnd() result = accusation_result() try: result.success = self._handler.accusation(args.ctx, args.commentId, args.comment, args.noteId, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("accusation", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_taxonomy(self, seqid, iprot, oprot): args = taxonomy_args() args.read(iprot) iprot.readMessageEnd() result = taxonomy_result() try: result.success = self._handler.taxonomy(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("taxonomy", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_taxonomyV2(self, seqid, iprot, oprot): args = taxonomyV2_args() args.read(iprot) iprot.readMessageEnd() result = taxonomyV2_result() try: result.success = self._handler.taxonomyV2(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("taxonomyV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_taxonomyW2(self, seqid, iprot, oprot): args = taxonomyW2_args() args.read(iprot) iprot.readMessageEnd() result = taxonomyW2_result() try: result.success = self._handler.taxonomyW2(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("taxonomyW2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_audioFinger(self, seqid, iprot, oprot): args = audioFinger_args() args.read(iprot) iprot.readMessageEnd() result = audioFinger_result() try: result.success = self._handler.audioFinger(args.ctx, args.noteId, args.noteType, args.videoKey) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("audioFinger", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_knowledge(self, seqid, iprot, oprot): args = knowledge_args() args.read(iprot) iprot.readMessageEnd() result = knowledge_result() try: result.success = self._handler.knowledge(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("knowledge", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteSecurity(self, seqid, iprot, oprot): args = noteSecurity_args() args.read(iprot) iprot.readMessageEnd() result = noteSecurity_result() try: result.success = self._handler.noteSecurity(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteSecurity", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_advertise(self, seqid, iprot, oprot): args = advertise_args() args.read(iprot) iprot.readMessageEnd() result = advertise_result() try: result.success = self._handler.advertise(args.ctx, args.noteId, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("advertise", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_giftBox(self, seqid, iprot, oprot): args = giftBox_args() args.read(iprot) iprot.readMessageEnd() result = giftBox_result() try: result.success = self._handler.giftBox(args.ctx, args.noteId, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("giftBox", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_giftBoxV2(self, seqid, iprot, oprot): args = giftBoxV2_args() args.read(iprot) iprot.readMessageEnd() result = giftBoxV2_result() try: result.success = self._handler.giftBoxV2(args.ctx, args.noteId, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("giftBoxV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_fashion(self, seqid, iprot, oprot): args = fashion_args() args.read(iprot) iprot.readMessageEnd() result = fashion_result() try: result.success = self._handler.fashion(args.ctx, args.noteId, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("fashion", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_feedbackClassify(self, seqid, iprot, oprot): args = feedbackClassify_args() args.read(iprot) iprot.readMessageEnd() result = feedbackClassify_result() try: result.success = self._handler.feedbackClassify(args.ctx, args.ticketNo, args.content, args.scenarioByUser, args.categoryByCUser) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("feedbackClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_tagClassification(self, seqid, iprot, oprot): args = tagClassification_args() args.read(iprot) iprot.readMessageEnd() result = tagClassification_result() try: result.success = self._handler.tagClassification(args.ctx, args.imgUrl, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("tagClassification", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_customerConversationClassify(self, seqid, iprot, oprot): args = customerConversationClassify_args() args.read(iprot) iprot.readMessageEnd() result = customerConversationClassify_result() try: result.success = self._handler.customerConversationClassify(args.ctx, args.caseId, args.chatId, args.turns) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("customerConversationClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_customerConversationClassifyV2(self, seqid, iprot, oprot): args = customerConversationClassifyV2_args() args.read(iprot) iprot.readMessageEnd() result = customerConversationClassifyV2_result() try: result.success = self._handler.customerConversationClassifyV2(args.ctx, args.caseId, args.chatId, args.turns) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("customerConversationClassifyV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_cover(self, seqid, iprot, oprot): args = cover_args() args.read(iprot) iprot.readMessageEnd() result = cover_result() try: result.success = self._handler.cover(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("cover", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_uncomfortable(self, seqid, iprot, oprot): args = uncomfortable_args() args.read(iprot) iprot.readMessageEnd() result = uncomfortable_result() try: result.success = self._handler.uncomfortable(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("uncomfortable", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_aestheticAssessment(self, seqid, iprot, oprot): args = aestheticAssessment_args() args.read(iprot) iprot.readMessageEnd() result = aestheticAssessment_result() try: result.success = self._handler.aestheticAssessment(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("aestheticAssessment", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_realphoto(self, seqid, iprot, oprot): args = realphoto_args() args.read(iprot) iprot.readMessageEnd() result = realphoto_result() try: result.success = self._handler.realphoto(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("realphoto", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_ctrEmbedding(self, seqid, iprot, oprot): args = ctrEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = ctrEmbedding_result() try: result.success = self._handler.ctrEmbedding(args.ctx, args.noteId, args.imgUrls) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ctrEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_ctrForSearch(self, seqid, iprot, oprot): args = ctrForSearch_args() args.read(iprot) iprot.readMessageEnd() result = ctrForSearch_result() try: result.success = self._handler.ctrForSearch(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ctrForSearch", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_suspectUser(self, seqid, iprot, oprot): args = suspectUser_args() args.read(iprot) iprot.readMessageEnd() result = suspectUser_result() try: result.success = self._handler.suspectUser(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("suspectUser", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_ctrRanking(self, seqid, iprot, oprot): args = ctrRanking_args() args.read(iprot) iprot.readMessageEnd() result = ctrRanking_result() try: result.success = self._handler.ctrRanking(args.ctx, args.noteId, args.imgUrls) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ctrRanking", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_videoTagging(self, seqid, iprot, oprot): args = videoTagging_args() args.read(iprot) iprot.readMessageEnd() result = videoTagging_result() try: result.success = self._handler.videoTagging(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("videoTagging", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTopic(self, seqid, iprot, oprot): args = newTopic_args() args.read(iprot) iprot.readMessageEnd() result = newTopic_result() try: result.success = self._handler.newTopic(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTopic", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTopicV2(self, seqid, iprot, oprot): args = newTopicV2_args() args.read(iprot) iprot.readMessageEnd() result = newTopicV2_result() try: result.success = self._handler.newTopicV2(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTopicV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newConceptionV1(self, seqid, iprot, oprot): args = newConceptionV1_args() args.read(iprot) iprot.readMessageEnd() result = newConceptionV1_result() try: result.success = self._handler.newConceptionV1(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList, args.imageOcrList, args.videoOcrList, args.searchTaxonomy1, args.searchTaxonomy2, args.noteTaxonomy1, args.noteTaxonomy2) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newConceptionV1", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTagV3(self, seqid, iprot, oprot): args = newTagV3_args() args.read(iprot) iprot.readMessageEnd() result = newTagV3_result() try: result.success = self._handler.newTagV3(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList, args.tax1, args.tax2) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTagV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTopicPostRule(self, seqid, iprot, oprot): args = newTopicPostRule_args() args.read(iprot) iprot.readMessageEnd() result = newTopicPostRule_result() try: result.success = self._handler.newTopicPostRule(args.ctx, args.noteId, args.topicList, args.titleList, args.contentList, args.resultList, args.confList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTopicPostRule", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_antiSEOV1(self, seqid, iprot, oprot): args = antiSEOV1_args() args.read(iprot) iprot.readMessageEnd() result = antiSEOV1_result() try: result.success = self._handler.antiSEOV1(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList, args.query_list, args.note_tax1_list, args.note_tax2_list, args.tag_tax1_list, args.tag_tax2_list) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("antiSEOV1", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTopicWiper(self, seqid, iprot, oprot): args = newTopicWiper_args() args.read(iprot) iprot.readMessageEnd() result = newTopicWiper_result() try: result.success = self._handler.newTopicWiper(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTopicWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTopicV2Wiper(self, seqid, iprot, oprot): args = newTopicV2Wiper_args() args.read(iprot) iprot.readMessageEnd() result = newTopicV2Wiper_result() try: result.success = self._handler.newTopicV2Wiper(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTopicV2Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_newTagV3Wiper(self, seqid, iprot, oprot): args = newTagV3Wiper_args() args.read(iprot) iprot.readMessageEnd() result = newTagV3Wiper_result() try: result.success = self._handler.newTagV3Wiper(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList, args.tax1, args.tax2) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("newTagV3Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_cdn2redkvWiper(self, seqid, iprot, oprot): args = cdn2redkvWiper_args() args.read(iprot) iprot.readMessageEnd() result = cdn2redkvWiper_result() try: result.success = self._handler.cdn2redkvWiper(args.ctx, args.note_id_list, args.note_type_list, args.image_list_list, args.key_frame_list_list) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("cdn2redkvWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_videoEmbedding(self, seqid, iprot, oprot): args = videoEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = videoEmbedding_result() try: result.success = self._handler.videoEmbedding(args.ctx, args.noteId, args.text, args.imgUrls) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("videoEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_normalEmbedding(self, seqid, iprot, oprot): args = normalEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = normalEmbedding_result() try: result.success = self._handler.normalEmbedding(args.ctx, args.noteId, args.imgUrls, args.title, args.content, args.huati) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("normalEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_commentInsult(self, seqid, iprot, oprot): args = commentInsult_args() args.read(iprot) iprot.readMessageEnd() result = commentInsult_result() try: result.success = self._handler.commentInsult(args.ctx, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("commentInsult", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_dishNer(self, seqid, iprot, oprot): args = dishNer_args() args.read(iprot) iprot.readMessageEnd() result = dishNer_result() try: result.success = self._handler.dishNer(args.ctx, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("dishNer", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_detect(self, seqid, iprot, oprot): args = detect_args() args.read(iprot) iprot.readMessageEnd() result = detect_result() try: result.success = self._handler.detect(args.ctx, args.imageUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("detect", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_faceRecognition(self, seqid, iprot, oprot): args = faceRecognition_args() args.read(iprot) iprot.readMessageEnd() result = faceRecognition_result() try: result.success = self._handler.faceRecognition(args.ctx, args.imgUrl, args.returnEmbedding) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("faceRecognition", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_querySimilarWords(self, seqid, iprot, oprot): args = querySimilarWords_args() args.read(iprot) iprot.readMessageEnd() result = querySimilarWords_result() try: result.success = self._handler.querySimilarWords(args.ctx, args.word, args.num) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("querySimilarWords", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getSimilarity(self, seqid, iprot, oprot): args = getSimilarity_args() args.read(iprot) iprot.readMessageEnd() result = getSimilarity_result() try: result.success = self._handler.getSimilarity(args.ctx, args.word1, args.word2) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getSimilarity", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_isDupPoi(self, seqid, iprot, oprot): args = isDupPoi_args() args.read(iprot) iprot.readMessageEnd() result = isDupPoi_result() try: result.success = self._handler.isDupPoi(args.ctx, args.vec, args.category) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("isDupPoi", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_musicDssmEmbedding(self, seqid, iprot, oprot): args = musicDssmEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = musicDssmEmbedding_result() try: result.success = self._handler.musicDssmEmbedding(args.ctx, args.imgUrl, args.topK) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("musicDssmEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getImageClassification(self, seqid, iprot, oprot): args = getImageClassification_args() args.read(iprot) iprot.readMessageEnd() result = getImageClassification_result() try: result.success = self._handler.getImageClassification(args.ctx, args.imgUrl, args.modelType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getImageClassification", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_isDupSpvV1(self, seqid, iprot, oprot): args = isDupSpvV1_args() args.read(iprot) iprot.readMessageEnd() result = isDupSpvV1_result() try: result.success = self._handler.isDupSpvV1(args.ctx, args.leftName, args.rightName, args.featureStr) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("isDupSpvV1", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sentimentAnalysis(self, seqid, iprot, oprot): args = sentimentAnalysis_args() args.read(iprot) iprot.readMessageEnd() result = sentimentAnalysis_result() try: result.success = self._handler.sentimentAnalysis(args.ctx, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sentimentAnalysis", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_topicDssmEmbedding(self, seqid, iprot, oprot): args = topicDssmEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = topicDssmEmbedding_result() try: result.success = self._handler.topicDssmEmbedding(args.ctx, args.title, args.content, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("topicDssmEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_splitSentence(self, seqid, iprot, oprot): args = splitSentence_args() args.read(iprot) iprot.readMessageEnd() result = splitSentence_result() try: result.success = self._handler.splitSentence(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("splitSentence", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_universalNer(self, seqid, iprot, oprot): args = universalNer_args() args.read(iprot) iprot.readMessageEnd() result = universalNer_result() try: result.success = self._handler.universalNer(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("universalNer", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_universalNerV2(self, seqid, iprot, oprot): args = universalNerV2_args() args.read(iprot) iprot.readMessageEnd() result = universalNerV2_result() try: result.success = self._handler.universalNerV2(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("universalNerV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_universalNerV3(self, seqid, iprot, oprot): args = universalNerV3_args() args.read(iprot) iprot.readMessageEnd() result = universalNerV3_result() try: result.success = self._handler.universalNerV3(args.ctx, args.texts, args.types) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("universalNerV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_brandClassify(self, seqid, iprot, oprot): args = brandClassify_args() args.read(iprot) iprot.readMessageEnd() result = brandClassify_result() try: result.success = self._handler.brandClassify(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("brandClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_brandClassifyV2(self, seqid, iprot, oprot): args = brandClassifyV2_args() args.read(iprot) iprot.readMessageEnd() result = brandClassifyV2_result() try: result.success = self._handler.brandClassifyV2(args.ctx, args.brandNames, args.title, args.content) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("brandClassifyV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_timeSensitiveClassify(self, seqid, iprot, oprot): args = timeSensitiveClassify_args() args.read(iprot) iprot.readMessageEnd() result = timeSensitiveClassify_result() try: result.success = self._handler.timeSensitiveClassify(args.ctx, args.title, args.content) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("timeSensitiveClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_whiteBoxCartoonize(self, seqid, iprot, oprot): args = whiteBoxCartoonize_args() args.read(iprot) iprot.readMessageEnd() result = whiteBoxCartoonize_result() try: result.success = self._handler.whiteBoxCartoonize(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("whiteBoxCartoonize", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_superResolution(self, seqid, iprot, oprot): args = superResolution_args() args.read(iprot) iprot.readMessageEnd() result = superResolution_result() try: result.success = self._handler.superResolution(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("superResolution", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteEcology(self, seqid, iprot, oprot): args = noteEcology_args() args.read(iprot) iprot.readMessageEnd() result = noteEcology_result() try: result.success = self._handler.noteEcology(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteEcology", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteQuality(self, seqid, iprot, oprot): args = noteQuality_args() args.read(iprot) iprot.readMessageEnd() result = noteQuality_result() try: result.success = self._handler.noteQuality(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteQuality", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteQualityV5(self, seqid, iprot, oprot): args = noteQualityV5_args() args.read(iprot) iprot.readMessageEnd() result = noteQualityV5_result() try: result.success = self._handler.noteQualityV5(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteQualityV5", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_petDetection(self, seqid, iprot, oprot): args = petDetection_args() args.read(iprot) iprot.readMessageEnd() result = petDetection_result() try: result.success = self._handler.petDetection(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("petDetection", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_tagCorrelation(self, seqid, iprot, oprot): args = tagCorrelation_args() args.read(iprot) iprot.readMessageEnd() result = tagCorrelation_result() try: result.success = self._handler.tagCorrelation(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("tagCorrelation", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_tagCorrelationV2(self, seqid, iprot, oprot): args = tagCorrelationV2_args() args.read(iprot) iprot.readMessageEnd() result = tagCorrelationV2_result() try: result.success = self._handler.tagCorrelationV2(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("tagCorrelationV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchDetection(self, seqid, iprot, oprot): args = searchDetection_args() args.read(iprot) iprot.readMessageEnd() result = searchDetection_result() try: result.success = self._handler.searchDetection(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchDetection", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchOfflineDetection(self, seqid, iprot, oprot): args = searchOfflineDetection_args() args.read(iprot) iprot.readMessageEnd() result = searchOfflineDetection_result() try: result.success = self._handler.searchOfflineDetection(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchOfflineDetection", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchEmbedding(self, seqid, iprot, oprot): args = searchEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = searchEmbedding_result() try: result.success = self._handler.searchEmbedding(args.ctx, args.imgUrl, args.box) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchClassification(self, seqid, iprot, oprot): args = searchClassification_args() args.read(iprot) iprot.readMessageEnd() result = searchClassification_result() try: result.success = self._handler.searchClassification(args.ctx, args.imgUrl, args.box) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchClassification", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchClassificationOffline(self, seqid, iprot, oprot): args = searchClassificationOffline_args() args.read(iprot) iprot.readMessageEnd() result = searchClassificationOffline_result() try: result.success = self._handler.searchClassificationOffline(args.ctx, args.imgUrl, args.box) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchClassificationOffline", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchPipeline(self, seqid, iprot, oprot): args = searchPipeline_args() args.read(iprot) iprot.readMessageEnd() result = searchPipeline_result() try: result.success = self._handler.searchPipeline(args.ctx, args.imgUrl, args.useClassification) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchPipeline", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchOfflinePipeline(self, seqid, iprot, oprot): args = searchOfflinePipeline_args() args.read(iprot) iprot.readMessageEnd() result = searchOfflinePipeline_result() try: result.success = self._handler.searchOfflinePipeline(args.ctx, args.imgUrl, args.useClassification) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchOfflinePipeline", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchRedCloudPipeline(self, seqid, iprot, oprot): args = searchRedCloudPipeline_args() args.read(iprot) iprot.readMessageEnd() result = searchRedCloudPipeline_result() try: result.success = self._handler.searchRedCloudPipeline(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchRedCloudPipeline", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_searchGisRedCloudPipeline(self, seqid, iprot, oprot): args = searchGisRedCloudPipeline_args() args.read(iprot) iprot.readMessageEnd() result = searchGisRedCloudPipeline_result() try: result.success = self._handler.searchGisRedCloudPipeline(args.ctx, args.imgUrl) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("searchGisRedCloudPipeline", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteStructure(self, seqid, iprot, oprot): args = noteStructure_args() args.read(iprot) iprot.readMessageEnd() result = noteStructure_result() try: result.success = self._handler.noteStructure(args.ctx, args.cate, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteStructure", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_baikeEntityLink(self, seqid, iprot, oprot): args = baikeEntityLink_args() args.read(iprot) iprot.readMessageEnd() result = baikeEntityLink_result() try: result.success = self._handler.baikeEntityLink(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("baikeEntityLink", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_baikeEntityLinkWiper(self, seqid, iprot, oprot): args = baikeEntityLinkWiper_args() args.read(iprot) iprot.readMessageEnd() result = baikeEntityLinkWiper_result() try: result.success = self._handler.baikeEntityLinkWiper(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("baikeEntityLinkWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_poiLinkRank(self, seqid, iprot, oprot): args = poiLinkRank_args() args.read(iprot) iprot.readMessageEnd() result = poiLinkRank_result() try: result.success = self._handler.poiLinkRank(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("poiLinkRank", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteCategoryLink(self, seqid, iprot, oprot): args = noteCategoryLink_args() args.read(iprot) iprot.readMessageEnd() result = noteCategoryLink_result() try: result.success = self._handler.noteCategoryLink(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteCategoryLink", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_goodsSpuLink(self, seqid, iprot, oprot): args = goodsSpuLink_args() args.read(iprot) iprot.readMessageEnd() result = goodsSpuLink_result() try: result.success = self._handler.goodsSpuLink(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("goodsSpuLink", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_goodsSpuLinkWiper(self, seqid, iprot, oprot): args = goodsSpuLinkWiper_args() args.read(iprot) iprot.readMessageEnd() result = goodsSpuLinkWiper_result() try: result.success = self._handler.goodsSpuLinkWiper(args.ctx, args.noteId, args.mention, args.context, args.candidate, args.mentionType) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("goodsSpuLinkWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtract(self, seqid, iprot, oprot): args = generalEntityExtract_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtract_result() try: result.success = self._handler.generalEntityExtract(args.ctx, args.note_id, args.cate, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtract", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtractV2(self, seqid, iprot, oprot): args = generalEntityExtractV2_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtractV2_result() try: result.success = self._handler.generalEntityExtractV2(args.ctx, args.note_id, args.cate, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtractV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtractV3(self, seqid, iprot, oprot): args = generalEntityExtractV3_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtractV3_result() try: result.success = self._handler.generalEntityExtractV3(args.ctx, args.note_id, args.cate, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtractV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtractV4(self, seqid, iprot, oprot): args = generalEntityExtractV4_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtractV4_result() try: result.success = self._handler.generalEntityExtractV4(args.ctx, args.note_id, args.cate, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtractV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtractV4Wiper(self, seqid, iprot, oprot): args = generalEntityExtractV4Wiper_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtractV4Wiper_result() try: result.success = self._handler.generalEntityExtractV4Wiper(args.ctx, args.note_id, args.cate, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtractV4Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityClassifyV4(self, seqid, iprot, oprot): args = generalEntityClassifyV4_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityClassifyV4_result() try: result.success = self._handler.generalEntityClassifyV4(args.ctx, args.note_id, args.cate, args.entities, args.entityFeature) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityClassifyV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityClassifyV4Wiper(self, seqid, iprot, oprot): args = generalEntityClassifyV4Wiper_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityClassifyV4Wiper_result() try: result.success = self._handler.generalEntityClassifyV4Wiper(args.ctx, args.note_id, args.cate, args.entities, args.entityFeature) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityClassifyV4Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityRelationV4(self, seqid, iprot, oprot): args = generalEntityRelationV4_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityRelationV4_result() try: result.success = self._handler.generalEntityRelationV4(args.ctx, args.note_id, args.cate, args.text, args.entities) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityRelationV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityRelationV4Wiper(self, seqid, iprot, oprot): args = generalEntityRelationV4Wiper_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityRelationV4Wiper_result() try: result.success = self._handler.generalEntityRelationV4Wiper(args.ctx, args.note_id, args.cate, args.text, args.entities) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityRelationV4Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_generalEntityExtractWiper(self, seqid, iprot, oprot): args = generalEntityExtractWiper_args() args.read(iprot) iprot.readMessageEnd() result = generalEntityExtractWiper_result() try: result.success = self._handler.generalEntityExtractWiper(args.ctx, args.note_id, args.cate, args.text) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("generalEntityExtractWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScore(self, seqid, iprot, oprot): args = importanceScore_args() args.read(iprot) iprot.readMessageEnd() result = importanceScore_result() try: result.success = self._handler.importanceScore(args.ctx, args.note_id, args.cate, args.text, args.entity_rst, args.usr_tag) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScore", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceWiper(self, seqid, iprot, oprot): args = importanceWiper_args() args.read(iprot) iprot.readMessageEnd() result = importanceWiper_result() try: result.success = self._handler.importanceWiper(args.ctx, args.note_id, args.cate, args.text, args.entity_rst, args.usr_tag) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScoreV3(self, seqid, iprot, oprot): args = importanceScoreV3_args() args.read(iprot) iprot.readMessageEnd() result = importanceScoreV3_result() try: result.success = self._handler.importanceScoreV3(args.ctx, args.note_id, args.cate, args.text, args.note_entities, args.standard_entities, args.usr_tag, args.note_title, args.note_topic) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScoreV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceWiperV3(self, seqid, iprot, oprot): args = importanceWiperV3_args() args.read(iprot) iprot.readMessageEnd() result = importanceWiperV3_result() try: result.success = self._handler.importanceWiperV3(args.ctx, args.note_id, args.cate, args.text, args.note_entities, args.standard_entities, args.usr_tag, args.note_title, args.note_topic) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceWiperV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScoreV4(self, seqid, iprot, oprot): args = importanceScoreV4_args() args.read(iprot) iprot.readMessageEnd() result = importanceScoreV4_result() try: result.success = self._handler.importanceScoreV4(args.ctx, args.note_id, args.cate, args.text, args.note_entities, args.standard_entities, args.usr_tag, args.note_title, args.note_topic) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScoreV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScoreV5(self, seqid, iprot, oprot): args = importanceScoreV5_args() args.read(iprot) iprot.readMessageEnd() result = importanceScoreV5_result() try: result.success = self._handler.importanceScoreV5(args.ctx, args.note_id, args.predict_note_entities, args.note_entities, args.taxonomy, args.note_title, args.usr_tag, args.note_content, args.ocr, args.note_type, args.images, args.videoframes, args.task) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScoreV5", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceWiperV5(self, seqid, iprot, oprot): args = importanceWiperV5_args() args.read(iprot) iprot.readMessageEnd() result = importanceWiperV5_result() try: result.success = self._handler.importanceWiperV5(args.ctx, args.note_id, args.predict_note_entities, args.note_entities, args.taxonomy, args.note_title, args.usr_tag, args.note_content, args.ocr, args.note_type, args.images, args.videoframes, args.task) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceWiperV5", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScoreV5Test(self, seqid, iprot, oprot): args = importanceScoreV5Test_args() args.read(iprot) iprot.readMessageEnd() result = importanceScoreV5Test_result() try: result.success = self._handler.importanceScoreV5Test(args.ctx, args.note_id, args.predict_note_entities, args.note_entities, args.taxonomy, args.note_title, args.usr_tag, args.note_content, args.ocr, args.note_type, args.images, args.videoframes, args.task) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScoreV5Test", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceWiperV4(self, seqid, iprot, oprot): args = importanceWiperV4_args() args.read(iprot) iprot.readMessageEnd() result = importanceWiperV4_result() try: result.success = self._handler.importanceWiperV4(args.ctx, args.note_id, args.cate, args.text, args.note_entities, args.standard_entities, args.usr_tag, args.note_title, args.note_topic) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceWiperV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_importanceScoreV4Test(self, seqid, iprot, oprot): args = importanceScoreV4Test_args() args.read(iprot) iprot.readMessageEnd() result = importanceScoreV4Test_result() try: result.success = self._handler.importanceScoreV4Test(args.ctx, args.note_id, args.cate, args.text, args.note_entities, args.standard_entities, args.usr_tag, args.note_title, args.note_topic) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("importanceScoreV4Test", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryNER(self, seqid, iprot, oprot): args = queryNER_args() args.read(iprot) iprot.readMessageEnd() result = queryNER_result() try: result.success = self._handler.queryNER(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryNER", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryNERV2(self, seqid, iprot, oprot): args = queryNERV2_args() args.read(iprot) iprot.readMessageEnd() result = queryNERV2_result() try: result.success = self._handler.queryNERV2(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryNERV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryNERV3(self, seqid, iprot, oprot): args = queryNERV3_args() args.read(iprot) iprot.readMessageEnd() result = queryNERV3_result() try: result.success = self._handler.queryNERV3(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryNERV3", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryNERV4(self, seqid, iprot, oprot): args = queryNERV4_args() args.read(iprot) iprot.readMessageEnd() result = queryNERV4_result() try: result.success = self._handler.queryNERV4(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryNERV4", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sentNER(self, seqid, iprot, oprot): args = sentNER_args() args.read(iprot) iprot.readMessageEnd() result = sentNER_result() try: result.success = self._handler.sentNER(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sentNER", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sentNERLatest(self, seqid, iprot, oprot): args = sentNERLatest_args() args.read(iprot) iprot.readMessageEnd() result = sentNERLatest_result() try: result.success = self._handler.sentNERLatest(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sentNERLatest", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteFeedback(self, seqid, iprot, oprot): args = noteFeedback_args() args.read(iprot) iprot.readMessageEnd() result = noteFeedback_result() try: result.success = self._handler.noteFeedback(args.ctx, args.note_id, args.title, args.content) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteFeedback", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteFeedbackV2(self, seqid, iprot, oprot): args = noteFeedbackV2_args() args.read(iprot) iprot.readMessageEnd() result = noteFeedbackV2_result() try: result.success = self._handler.noteFeedbackV2(args.ctx, args.note_id, args.title, args.content) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteFeedbackV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_amazingCover(self, seqid, iprot, oprot): args = amazingCover_args() args.read(iprot) iprot.readMessageEnd() result = amazingCover_result() try: result.success = self._handler.amazingCover(args.ctx, args.key_frames) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("amazingCover", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteEmbedding(self, seqid, iprot, oprot): args = noteEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = noteEmbedding_result() try: result.success = self._handler.noteEmbedding(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteEmbeddingWiper(self, seqid, iprot, oprot): args = noteEmbeddingWiper_args() args.read(iprot) iprot.readMessageEnd() result = noteEmbeddingWiper_result() try: result.success = self._handler.noteEmbeddingWiper(args.ctx, args.noteId, args.noteType, args.useCache, args.topicList, args.titleList, args.contentList, args.imageList, args.keyFrameList) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteEmbeddingWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteInformationClassify(self, seqid, iprot, oprot): args = noteInformationClassify_args() args.read(iprot) iprot.readMessageEnd() result = noteInformationClassify_result() try: result.success = self._handler.noteInformationClassify(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteInformationClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteInformationClassifyV2(self, seqid, iprot, oprot): args = noteInformationClassifyV2_args() args.read(iprot) iprot.readMessageEnd() result = noteInformationClassifyV2_result() try: result.success = self._handler.noteInformationClassifyV2(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteInformationClassifyV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteInformationClassifyV2Wiper(self, seqid, iprot, oprot): args = noteInformationClassifyV2Wiper_args() args.read(iprot) iprot.readMessageEnd() result = noteInformationClassifyV2Wiper_result() try: result.success = self._handler.noteInformationClassifyV2Wiper(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteInformationClassifyV2Wiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteTimelinessClassify(self, seqid, iprot, oprot): args = noteTimelinessClassify_args() args.read(iprot) iprot.readMessageEnd() result = noteTimelinessClassify_result() try: result.success = self._handler.noteTimelinessClassify(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteTimelinessClassify", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_noteTimelinessClassifyWiper(self, seqid, iprot, oprot): args = noteTimelinessClassifyWiper_args() args.read(iprot) iprot.readMessageEnd() result = noteTimelinessClassifyWiper_result() try: result.success = self._handler.noteTimelinessClassifyWiper(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("noteTimelinessClassifyWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryEmbedding(self, seqid, iprot, oprot): args = queryEmbedding_args() args.read(iprot) iprot.readMessageEnd() result = queryEmbedding_result() try: result.success = self._handler.queryEmbedding(args.ctx, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryEmbedding", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryEmbeddingV2(self, seqid, iprot, oprot): args = queryEmbeddingV2_args() args.read(iprot) iprot.readMessageEnd() result = queryEmbeddingV2_result() try: result.success = self._handler.queryEmbeddingV2(args.ctx, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryEmbeddingV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryBatchEmbeddingV2(self, seqid, iprot, oprot): args = queryBatchEmbeddingV2_args() args.read(iprot) iprot.readMessageEnd() result = queryBatchEmbeddingV2_result() try: result.success = self._handler.queryBatchEmbeddingV2(args.ctx, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("queryBatchEmbeddingV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getLabelCorrelation(self, seqid, iprot, oprot): args = getLabelCorrelation_args() args.read(iprot) iprot.readMessageEnd() result = getLabelCorrelation_result() try: result.success = self._handler.getLabelCorrelation(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getLabelCorrelation", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getDocGenerateQuery(self, seqid, iprot, oprot): args = getDocGenerateQuery_args() args.read(iprot) iprot.readMessageEnd() result = getDocGenerateQuery_result() try: result.success = self._handler.getDocGenerateQuery(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getDocGenerateQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_baikeParse(self, seqid, iprot, oprot): args = baikeParse_args() args.read(iprot) iprot.readMessageEnd() result = baikeParse_result() try: result.success = self._handler.baikeParse(args.ctx, args.url) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("baikeParse", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_baikeParseWiper(self, seqid, iprot, oprot): args = baikeParseWiper_args() args.read(iprot) iprot.readMessageEnd() result = baikeParseWiper_result() try: result.success = self._handler.baikeParseWiper(args.ctx, args.url) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("baikeParseWiper", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getNoteIntent(self, seqid, iprot, oprot): args = getNoteIntent_args() args.read(iprot) iprot.readMessageEnd() result = getNoteIntent_result() try: result.success = self._handler.getNoteIntent(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getNoteIntent", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQueryGeneralIntent(self, seqid, iprot, oprot): args = getQueryGeneralIntent_args() args.read(iprot) iprot.readMessageEnd() result = getQueryGeneralIntent_result() try: result.success = self._handler.getQueryGeneralIntent(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQueryGeneralIntent", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQueryGeneralIntentV2(self, seqid, iprot, oprot): args = getQueryGeneralIntentV2_args() args.read(iprot) iprot.readMessageEnd() result = getQueryGeneralIntentV2_result() try: result.success = self._handler.getQueryGeneralIntentV2(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQueryGeneralIntentV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQueryQualityV2(self, seqid, iprot, oprot): args = getQueryQualityV2_args() args.read(iprot) iprot.readMessageEnd() result = getQueryQualityV2_result() try: result.success = self._handler.getQueryQualityV2(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQueryQualityV2", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQueryCorrection(self, seqid, iprot, oprot): args = getQueryCorrection_args() args.read(iprot) iprot.readMessageEnd() result = getQueryCorrection_result() try: result.success = self._handler.getQueryCorrection(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQueryCorrection", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQualityPPL(self, seqid, iprot, oprot): args = getQualityPPL_args() args.read(iprot) iprot.readMessageEnd() result = getQualityPPL_result() try: result.success = self._handler.getQualityPPL(args.ctx, args.texts) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQualityPPL", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getQuerySynonym(self, seqid, iprot, oprot): args = getQuerySynonym_args() args.read(iprot) iprot.readMessageEnd() result = getQuerySynonym_result() try: result.success = self._handler.getQuerySynonym(args.ctx, args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getQuerySynonym", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_caesarCommonQuery(self, seqid, iprot, oprot): args = caesarCommonQuery_args() args.read(iprot) iprot.readMessageEnd() result = caesarCommonQuery_result() try: result.success = self._handler.caesarCommonQuery(args.ctx, args.caesarCommonRequest) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("caesarCommonQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) class newGender_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype12, _size9) = iprot.readListBegin() for _i13 in range(_size9): _elem14 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem14) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype18, _size15) = iprot.readListBegin() for _i19 in range(_size15): _elem20 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem20) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype24, _size21) = iprot.readListBegin() for _i25 in range(_size21): _elem26 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem26) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype30, _size27) = iprot.readListBegin() for _i31 in range(_size27): _elem32 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem32) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype36, _size33) = iprot.readListBegin() for _i37 in range(_size33): _elem38 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem38) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newGender_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter39 in self.topicList: oprot.writeString(iter39.encode('utf-8') if sys.version_info[0] == 2 else iter39) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter40 in self.titleList: oprot.writeString(iter40.encode('utf-8') if sys.version_info[0] == 2 else iter40) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter41 in self.contentList: oprot.writeString(iter41.encode('utf-8') if sys.version_info[0] == 2 else iter41) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter42 in self.imageList: oprot.writeString(iter42.encode('utf-8') if sys.version_info[0] == 2 else iter42) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter43 in self.keyFrameList: oprot.writeString(iter43.encode('utf-8') if sys.version_info[0] == 2 else iter43) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newGender_args) newGender_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class newGender_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newGender_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newGender_result) newGender_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class genderV2_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype47, _size44) = iprot.readListBegin() for _i48 in range(_size44): _elem49 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem49) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype53, _size50) = iprot.readListBegin() for _i54 in range(_size50): _elem55 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem55) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype59, _size56) = iprot.readListBegin() for _i60 in range(_size56): _elem61 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem61) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype65, _size62) = iprot.readListBegin() for _i66 in range(_size62): _elem67 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem67) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype71, _size68) = iprot.readListBegin() for _i72 in range(_size68): _elem73 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem73) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('genderV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter74 in self.topicList: oprot.writeString(iter74.encode('utf-8') if sys.version_info[0] == 2 else iter74) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter75 in self.titleList: oprot.writeString(iter75.encode('utf-8') if sys.version_info[0] == 2 else iter75) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter76 in self.contentList: oprot.writeString(iter76.encode('utf-8') if sys.version_info[0] == 2 else iter76) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter77 in self.imageList: oprot.writeString(iter77.encode('utf-8') if sys.version_info[0] == 2 else iter77) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter78 in self.keyFrameList: oprot.writeString(iter78.encode('utf-8') if sys.version_info[0] == 2 else iter78) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(genderV2_args) genderV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class genderV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('genderV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(genderV2_result) genderV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class LocalizationClassify_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype82, _size79) = iprot.readListBegin() for _i83 in range(_size79): _elem84 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem84) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype88, _size85) = iprot.readListBegin() for _i89 in range(_size85): _elem90 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem90) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype94, _size91) = iprot.readListBegin() for _i95 in range(_size91): _elem96 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem96) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype100, _size97) = iprot.readListBegin() for _i101 in range(_size97): _elem102 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem102) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype106, _size103) = iprot.readListBegin() for _i107 in range(_size103): _elem108 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem108) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LocalizationClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter109 in self.topicList: oprot.writeString(iter109.encode('utf-8') if sys.version_info[0] == 2 else iter109) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter110 in self.titleList: oprot.writeString(iter110.encode('utf-8') if sys.version_info[0] == 2 else iter110) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter111 in self.contentList: oprot.writeString(iter111.encode('utf-8') if sys.version_info[0] == 2 else iter111) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter112 in self.imageList: oprot.writeString(iter112.encode('utf-8') if sys.version_info[0] == 2 else iter112) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter113 in self.keyFrameList: oprot.writeString(iter113.encode('utf-8') if sys.version_info[0] == 2 else iter113) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(LocalizationClassify_args) LocalizationClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class LocalizationClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LocalizationClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(LocalizationClassify_result) LocalizationClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class LocalizationClassifyWiper_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype117, _size114) = iprot.readListBegin() for _i118 in range(_size114): _elem119 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem119) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype123, _size120) = iprot.readListBegin() for _i124 in range(_size120): _elem125 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem125) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype129, _size126) = iprot.readListBegin() for _i130 in range(_size126): _elem131 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem131) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype135, _size132) = iprot.readListBegin() for _i136 in range(_size132): _elem137 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem137) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype141, _size138) = iprot.readListBegin() for _i142 in range(_size138): _elem143 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem143) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LocalizationClassifyWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter144 in self.topicList: oprot.writeString(iter144.encode('utf-8') if sys.version_info[0] == 2 else iter144) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter145 in self.titleList: oprot.writeString(iter145.encode('utf-8') if sys.version_info[0] == 2 else iter145) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter146 in self.contentList: oprot.writeString(iter146.encode('utf-8') if sys.version_info[0] == 2 else iter146) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter147 in self.imageList: oprot.writeString(iter147.encode('utf-8') if sys.version_info[0] == 2 else iter147) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter148 in self.keyFrameList: oprot.writeString(iter148.encode('utf-8') if sys.version_info[0] == 2 else iter148) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(LocalizationClassifyWiper_args) LocalizationClassifyWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class LocalizationClassifyWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LocalizationClassifyWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(LocalizationClassifyWiper_result) LocalizationClassifyWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class genderV3_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('genderV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(genderV3_args) genderV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class genderV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('genderV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(genderV3_result) genderV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class highShow_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype152, _size149) = iprot.readListBegin() for _i153 in range(_size149): _elem154 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem154) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype158, _size155) = iprot.readListBegin() for _i159 in range(_size155): _elem160 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem160) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype164, _size161) = iprot.readListBegin() for _i165 in range(_size161): _elem166 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem166) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype170, _size167) = iprot.readListBegin() for _i171 in range(_size167): _elem172 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem172) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype176, _size173) = iprot.readListBegin() for _i177 in range(_size173): _elem178 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem178) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('highShow_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter179 in self.topicList: oprot.writeString(iter179.encode('utf-8') if sys.version_info[0] == 2 else iter179) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter180 in self.titleList: oprot.writeString(iter180.encode('utf-8') if sys.version_info[0] == 2 else iter180) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter181 in self.contentList: oprot.writeString(iter181.encode('utf-8') if sys.version_info[0] == 2 else iter181) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter182 in self.imageList: oprot.writeString(iter182.encode('utf-8') if sys.version_info[0] == 2 else iter182) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter183 in self.keyFrameList: oprot.writeString(iter183.encode('utf-8') if sys.version_info[0] == 2 else iter183) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(highShow_args) highShow_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class highShow_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('highShow_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(highShow_result) highShow_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class sincere_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype187, _size184) = iprot.readListBegin() for _i188 in range(_size184): _elem189 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem189) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype193, _size190) = iprot.readListBegin() for _i194 in range(_size190): _elem195 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem195) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype199, _size196) = iprot.readListBegin() for _i200 in range(_size196): _elem201 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem201) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype205, _size202) = iprot.readListBegin() for _i206 in range(_size202): _elem207 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem207) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype211, _size208) = iprot.readListBegin() for _i212 in range(_size208): _elem213 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem213) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sincere_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter214 in self.topicList: oprot.writeString(iter214.encode('utf-8') if sys.version_info[0] == 2 else iter214) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter215 in self.titleList: oprot.writeString(iter215.encode('utf-8') if sys.version_info[0] == 2 else iter215) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter216 in self.contentList: oprot.writeString(iter216.encode('utf-8') if sys.version_info[0] == 2 else iter216) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter217 in self.imageList: oprot.writeString(iter217.encode('utf-8') if sys.version_info[0] == 2 else iter217) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter218 in self.keyFrameList: oprot.writeString(iter218.encode('utf-8') if sys.version_info[0] == 2 else iter218) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sincere_args) sincere_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class sincere_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sincere_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sincere_result) sincere_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class badNote_args(object): """ Attributes: - ctx - text """ def __init__(self, ctx=None, text=None,): self.ctx = ctx self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('badNote_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(badNote_args) badNote_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) class badNote_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('badNote_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(badNote_result) badNote_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class badComment_args(object): """ Attributes: - ctx - text """ def __init__(self, ctx=None, text=None,): self.ctx = ctx self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('badComment_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(badComment_args) badComment_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) class badComment_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('badComment_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(badComment_result) badComment_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class aigoTrain_args(object): """ Attributes: - ctx - datasetPath - modelType - projectId - modelVersion - config """ def __init__(self, ctx=None, datasetPath=None, modelType=None, projectId=None, modelVersion=None, config=None,): self.ctx = ctx self.datasetPath = datasetPath self.modelType = modelType self.projectId = projectId self.modelVersion = modelVersion self.config = config def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.datasetPath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.modelType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.projectId = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.modelVersion = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: self.config = titancaesar.thrift.caesar.dto.ttypes.AiGoTrainConfig() self.config.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aigoTrain_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.datasetPath is not None: oprot.writeFieldBegin('datasetPath', TType.STRING, 2) oprot.writeString(self.datasetPath.encode('utf-8') if sys.version_info[0] == 2 else self.datasetPath) oprot.writeFieldEnd() if self.modelType is not None: oprot.writeFieldBegin('modelType', TType.STRING, 3) oprot.writeString(self.modelType.encode('utf-8') if sys.version_info[0] == 2 else self.modelType) oprot.writeFieldEnd() if self.projectId is not None: oprot.writeFieldBegin('projectId', TType.I32, 4) oprot.writeI32(self.projectId) oprot.writeFieldEnd() if self.modelVersion is not None: oprot.writeFieldBegin('modelVersion', TType.STRING, 5) oprot.writeString(self.modelVersion.encode('utf-8') if sys.version_info[0] == 2 else self.modelVersion) oprot.writeFieldEnd() if self.config is not None: oprot.writeFieldBegin('config', TType.STRUCT, 6) self.config.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.datasetPath is None: raise TProtocolException(message='Required field datasetPath is unset!') if self.modelType is None: raise TProtocolException(message='Required field modelType is unset!') if self.projectId is None: raise TProtocolException(message='Required field projectId is unset!') if self.modelVersion is None: raise TProtocolException(message='Required field modelVersion is unset!') if self.config is None: raise TProtocolException(message='Required field config is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aigoTrain_args) aigoTrain_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'datasetPath', 'UTF8', None, ), # 2 (3, TType.STRING, 'modelType', 'UTF8', None, ), # 3 (4, TType.I32, 'projectId', None, None, ), # 4 (5, TType.STRING, 'modelVersion', 'UTF8', None, ), # 5 (6, TType.STRUCT, 'config', [titancaesar.thrift.caesar.dto.ttypes.AiGoTrainConfig, None], None, ), # 6 ) class aigoTrain_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.Result() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aigoTrain_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aigoTrain_result) aigoTrain_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.Result, None], None, ), # 0 ) class aigoTest_args(object): """ Attributes: - ctx - materials - modelType - modelPath """ def __init__(self, ctx=None, materials=None, modelType=None, modelPath=None,): self.ctx = ctx self.materials = materials self.modelType = modelType self.modelPath = modelPath def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.materials = [] (_etype222, _size219) = iprot.readListBegin() for _i223 in range(_size219): _elem224 = titancaesar.thrift.caesar.dto.ttypes.AigoMaterial() _elem224.read(iprot) self.materials.append(_elem224) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.modelType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.modelPath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aigoTest_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.materials is not None: oprot.writeFieldBegin('materials', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.materials)) for iter225 in self.materials: iter225.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.modelType is not None: oprot.writeFieldBegin('modelType', TType.STRING, 3) oprot.writeString(self.modelType.encode('utf-8') if sys.version_info[0] == 2 else self.modelType) oprot.writeFieldEnd() if self.modelPath is not None: oprot.writeFieldBegin('modelPath', TType.STRING, 4) oprot.writeString(self.modelPath.encode('utf-8') if sys.version_info[0] == 2 else self.modelPath) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.materials is None: raise TProtocolException(message='Required field materials is unset!') if self.modelType is None: raise TProtocolException(message='Required field modelType is unset!') if self.modelPath is None: raise TProtocolException(message='Required field modelPath is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aigoTest_args) aigoTest_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'materials', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.AigoMaterial, None], False), None, ), # 2 (3, TType.STRING, 'modelType', 'UTF8', None, ), # 3 (4, TType.STRING, 'modelPath', 'UTF8', None, ), # 4 ) class aigoTest_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype229, _size226) = iprot.readListBegin() for _i230 in range(_size226): _elem231 = titancaesar.thrift.caesar.dto.ttypes.AigoTestResult() _elem231.read(iprot) self.success.append(_elem231) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aigoTest_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter232 in self.success: iter232.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aigoTest_result) aigoTest_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.AigoTestResult, None], False), None, ), # 0 ) class commentClassify_args(object): """ Attributes: - ctx - text - sameAuthor - contextText """ def __init__(self, ctx=None, text=None, sameAuthor=None, contextText=None,): self.ctx = ctx self.text = text self.sameAuthor = sameAuthor self.contextText = contextText def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.sameAuthor = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.contextText = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.sameAuthor is not None: oprot.writeFieldBegin('sameAuthor', TType.BOOL, 3) oprot.writeBool(self.sameAuthor) oprot.writeFieldEnd() if self.contextText is not None: oprot.writeFieldBegin('contextText', TType.STRING, 4) oprot.writeString(self.contextText.encode('utf-8') if sys.version_info[0] == 2 else self.contextText) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.sameAuthor is None: raise TProtocolException(message='Required field sameAuthor is unset!') if self.contextText is None: raise TProtocolException(message='Required field contextText is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassify_args) commentClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 (3, TType.BOOL, 'sameAuthor', None, None, ), # 3 (4, TType.STRING, 'contextText', 'UTF8', None, ), # 4 ) class commentClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CommentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassify_result) commentClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CommentResult, None], None, ), # 0 ) class commentClassifyV2_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.CommentRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassifyV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassifyV2_args) commentClassifyV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.CommentRequest, None], None, ), # 2 ) class commentClassifyV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CommentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassifyV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassifyV2_result) commentClassifyV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CommentResult, None], None, ), # 0 ) class commentSecurityClassify_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.CommentRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentSecurityClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentSecurityClassify_args) commentSecurityClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.CommentRequest, None], None, ), # 2 ) class commentSecurityClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CommentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentSecurityClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentSecurityClassify_result) commentSecurityClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CommentResult, None], None, ), # 0 ) class commentOrderClassify_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.CommentRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentOrderClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentOrderClassify_args) commentOrderClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.CommentRequest, None], None, ), # 2 ) class commentOrderClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CommentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentOrderClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentOrderClassify_result) commentOrderClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CommentResult, None], None, ), # 0 ) class commentClassifyTest_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.CommentRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassifyTest_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassifyTest_args) commentClassifyTest_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.CommentRequest, None], None, ), # 2 ) class commentClassifyTest_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CommentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentClassifyTest_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentClassifyTest_result) commentClassifyTest_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CommentResult, None], None, ), # 0 ) class danmuSentiment_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.DanmuRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('danmuSentiment_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(danmuSentiment_args) danmuSentiment_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.DanmuRequest, None], None, ), # 2 ) class danmuSentiment_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.DanmuResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('danmuSentiment_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(danmuSentiment_result) danmuSentiment_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.DanmuResult, None], None, ), # 0 ) class danmuSentiment_apple_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.DanmuRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('danmuSentiment_apple_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(danmuSentiment_apple_args) danmuSentiment_apple_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.DanmuRequest, None], None, ), # 2 ) class danmuSentiment_apple_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.DanmuResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('danmuSentiment_apple_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(danmuSentiment_apple_result) danmuSentiment_apple_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.DanmuResult, None], None, ), # 0 ) class accusation_args(object): """ Attributes: - ctx - commentId - comment - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, commentId=None, comment=None, noteId=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.commentId = commentId self.comment = comment self.noteId = noteId self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.commentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.comment = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.topicList = [] (_etype236, _size233) = iprot.readListBegin() for _i237 in range(_size233): _elem238 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem238) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.titleList = [] (_etype242, _size239) = iprot.readListBegin() for _i243 in range(_size239): _elem244 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem244) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.contentList = [] (_etype248, _size245) = iprot.readListBegin() for _i249 in range(_size245): _elem250 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem250) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.imageList = [] (_etype254, _size251) = iprot.readListBegin() for _i255 in range(_size251): _elem256 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem256) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.keyFrameList = [] (_etype260, _size257) = iprot.readListBegin() for _i261 in range(_size257): _elem262 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem262) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('accusation_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.commentId is not None: oprot.writeFieldBegin('commentId', TType.STRING, 2) oprot.writeString(self.commentId.encode('utf-8') if sys.version_info[0] == 2 else self.commentId) oprot.writeFieldEnd() if self.comment is not None: oprot.writeFieldBegin('comment', TType.STRING, 3) oprot.writeString(self.comment.encode('utf-8') if sys.version_info[0] == 2 else self.comment) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 4) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 5) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter263 in self.topicList: oprot.writeString(iter263.encode('utf-8') if sys.version_info[0] == 2 else iter263) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter264 in self.titleList: oprot.writeString(iter264.encode('utf-8') if sys.version_info[0] == 2 else iter264) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter265 in self.contentList: oprot.writeString(iter265.encode('utf-8') if sys.version_info[0] == 2 else iter265) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter266 in self.imageList: oprot.writeString(iter266.encode('utf-8') if sys.version_info[0] == 2 else iter266) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter267 in self.keyFrameList: oprot.writeString(iter267.encode('utf-8') if sys.version_info[0] == 2 else iter267) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.commentId is None: raise TProtocolException(message='Required field commentId is unset!') if self.comment is None: raise TProtocolException(message='Required field comment is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(accusation_args) accusation_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'commentId', 'UTF8', None, ), # 2 (3, TType.STRING, 'comment', 'UTF8', None, ), # 3 (4, TType.STRING, 'noteId', 'UTF8', None, ), # 4 (5, TType.BOOL, 'useCache', None, None, ), # 5 (6, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 10 ) class accusation_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.AccusationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('accusation_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(accusation_result) accusation_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.AccusationResult, None], None, ), # 0 ) class taxonomy_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype271, _size268) = iprot.readListBegin() for _i272 in range(_size268): _elem273 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem273) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype277, _size274) = iprot.readListBegin() for _i278 in range(_size274): _elem279 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem279) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype283, _size280) = iprot.readListBegin() for _i284 in range(_size280): _elem285 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem285) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype289, _size286) = iprot.readListBegin() for _i290 in range(_size286): _elem291 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem291) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype295, _size292) = iprot.readListBegin() for _i296 in range(_size292): _elem297 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem297) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomy_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter298 in self.topicList: oprot.writeString(iter298.encode('utf-8') if sys.version_info[0] == 2 else iter298) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter299 in self.titleList: oprot.writeString(iter299.encode('utf-8') if sys.version_info[0] == 2 else iter299) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter300 in self.contentList: oprot.writeString(iter300.encode('utf-8') if sys.version_info[0] == 2 else iter300) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter301 in self.imageList: oprot.writeString(iter301.encode('utf-8') if sys.version_info[0] == 2 else iter301) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter302 in self.keyFrameList: oprot.writeString(iter302.encode('utf-8') if sys.version_info[0] == 2 else iter302) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomy_args) taxonomy_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class taxonomy_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.TaxonomyResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomy_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomy_result) taxonomy_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.TaxonomyResult, None], None, ), # 0 ) class taxonomyV2_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype306, _size303) = iprot.readListBegin() for _i307 in range(_size303): _elem308 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem308) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype312, _size309) = iprot.readListBegin() for _i313 in range(_size309): _elem314 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem314) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype318, _size315) = iprot.readListBegin() for _i319 in range(_size315): _elem320 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem320) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype324, _size321) = iprot.readListBegin() for _i325 in range(_size321): _elem326 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem326) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype330, _size327) = iprot.readListBegin() for _i331 in range(_size327): _elem332 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem332) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomyV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter333 in self.topicList: oprot.writeString(iter333.encode('utf-8') if sys.version_info[0] == 2 else iter333) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter334 in self.titleList: oprot.writeString(iter334.encode('utf-8') if sys.version_info[0] == 2 else iter334) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter335 in self.contentList: oprot.writeString(iter335.encode('utf-8') if sys.version_info[0] == 2 else iter335) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter336 in self.imageList: oprot.writeString(iter336.encode('utf-8') if sys.version_info[0] == 2 else iter336) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter337 in self.keyFrameList: oprot.writeString(iter337.encode('utf-8') if sys.version_info[0] == 2 else iter337) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomyV2_args) taxonomyV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class taxonomyV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.TaxonomyV2Result() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomyV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomyV2_result) taxonomyV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.TaxonomyV2Result, None], None, ), # 0 ) class taxonomyW2_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype341, _size338) = iprot.readListBegin() for _i342 in range(_size338): _elem343 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem343) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype347, _size344) = iprot.readListBegin() for _i348 in range(_size344): _elem349 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem349) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype353, _size350) = iprot.readListBegin() for _i354 in range(_size350): _elem355 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem355) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype359, _size356) = iprot.readListBegin() for _i360 in range(_size356): _elem361 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem361) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype365, _size362) = iprot.readListBegin() for _i366 in range(_size362): _elem367 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem367) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomyW2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter368 in self.topicList: oprot.writeString(iter368.encode('utf-8') if sys.version_info[0] == 2 else iter368) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter369 in self.titleList: oprot.writeString(iter369.encode('utf-8') if sys.version_info[0] == 2 else iter369) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter370 in self.contentList: oprot.writeString(iter370.encode('utf-8') if sys.version_info[0] == 2 else iter370) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter371 in self.imageList: oprot.writeString(iter371.encode('utf-8') if sys.version_info[0] == 2 else iter371) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter372 in self.keyFrameList: oprot.writeString(iter372.encode('utf-8') if sys.version_info[0] == 2 else iter372) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomyW2_args) taxonomyW2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class taxonomyW2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.TaxonomyV2Result() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('taxonomyW2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(taxonomyW2_result) taxonomyW2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.TaxonomyV2Result, None], None, ), # 0 ) class audioFinger_args(object): """ Attributes: - ctx - noteId - noteType - videoKey """ def __init__(self, ctx=None, noteId=None, noteType=None, videoKey=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.videoKey = videoKey def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.videoKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('audioFinger_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.videoKey is not None: oprot.writeFieldBegin('videoKey', TType.STRING, 4) oprot.writeString(self.videoKey.encode('utf-8') if sys.version_info[0] == 2 else self.videoKey) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.videoKey is None: raise TProtocolException(message='Required field videoKey is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(audioFinger_args) audioFinger_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.STRING, 'videoKey', 'UTF8', None, ), # 4 ) class audioFinger_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype376, _size373) = iprot.readListBegin() for _i377 in range(_size373): _elem378 = titancaesar.thrift.caesar.dto.ttypes.AudioResult() _elem378.read(iprot) self.success.append(_elem378) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('audioFinger_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter379 in self.success: iter379.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(audioFinger_result) audioFinger_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.AudioResult, None], False), None, ), # 0 ) class knowledge_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype383, _size380) = iprot.readListBegin() for _i384 in range(_size380): _elem385 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem385) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype389, _size386) = iprot.readListBegin() for _i390 in range(_size386): _elem391 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem391) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype395, _size392) = iprot.readListBegin() for _i396 in range(_size392): _elem397 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem397) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype401, _size398) = iprot.readListBegin() for _i402 in range(_size398): _elem403 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem403) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype407, _size404) = iprot.readListBegin() for _i408 in range(_size404): _elem409 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem409) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('knowledge_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter410 in self.topicList: oprot.writeString(iter410.encode('utf-8') if sys.version_info[0] == 2 else iter410) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter411 in self.titleList: oprot.writeString(iter411.encode('utf-8') if sys.version_info[0] == 2 else iter411) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter412 in self.contentList: oprot.writeString(iter412.encode('utf-8') if sys.version_info[0] == 2 else iter412) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter413 in self.imageList: oprot.writeString(iter413.encode('utf-8') if sys.version_info[0] == 2 else iter413) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter414 in self.keyFrameList: oprot.writeString(iter414.encode('utf-8') if sys.version_info[0] == 2 else iter414) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(knowledge_args) knowledge_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class knowledge_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.KnowledgeResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('knowledge_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(knowledge_result) knowledge_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.KnowledgeResult, None], None, ), # 0 ) class noteSecurity_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype418, _size415) = iprot.readListBegin() for _i419 in range(_size415): _elem420 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem420) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype424, _size421) = iprot.readListBegin() for _i425 in range(_size421): _elem426 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem426) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype430, _size427) = iprot.readListBegin() for _i431 in range(_size427): _elem432 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem432) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype436, _size433) = iprot.readListBegin() for _i437 in range(_size433): _elem438 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem438) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype442, _size439) = iprot.readListBegin() for _i443 in range(_size439): _elem444 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem444) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteSecurity_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter445 in self.topicList: oprot.writeString(iter445.encode('utf-8') if sys.version_info[0] == 2 else iter445) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter446 in self.titleList: oprot.writeString(iter446.encode('utf-8') if sys.version_info[0] == 2 else iter446) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter447 in self.contentList: oprot.writeString(iter447.encode('utf-8') if sys.version_info[0] == 2 else iter447) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter448 in self.imageList: oprot.writeString(iter448.encode('utf-8') if sys.version_info[0] == 2 else iter448) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter449 in self.keyFrameList: oprot.writeString(iter449.encode('utf-8') if sys.version_info[0] == 2 else iter449) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteSecurity_args) noteSecurity_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class noteSecurity_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteSecurityResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteSecurity_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteSecurity_result) noteSecurity_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteSecurityResult, None], None, ), # 0 ) class advertise_args(object): """ Attributes: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ def __init__(self, ctx=None, noteId=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None,): self.ctx = ctx self.noteId = noteId self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype453, _size450) = iprot.readListBegin() for _i454 in range(_size450): _elem455 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem455) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype459, _size456) = iprot.readListBegin() for _i460 in range(_size456): _elem461 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem461) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype465, _size462) = iprot.readListBegin() for _i466 in range(_size462): _elem467 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem467) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype471, _size468) = iprot.readListBegin() for _i472 in range(_size468): _elem473 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem473) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('advertise_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter474 in self.topicList: oprot.writeString(iter474.encode('utf-8') if sys.version_info[0] == 2 else iter474) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter475 in self.titleList: oprot.writeString(iter475.encode('utf-8') if sys.version_info[0] == 2 else iter475) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter476 in self.contentList: oprot.writeString(iter476.encode('utf-8') if sys.version_info[0] == 2 else iter476) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter477 in self.imageList: oprot.writeString(iter477.encode('utf-8') if sys.version_info[0] == 2 else iter477) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(advertise_args) advertise_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 ) class advertise_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.AdvertiseResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('advertise_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(advertise_result) advertise_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.AdvertiseResult, None], None, ), # 0 ) class giftBox_args(object): """ Attributes: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ def __init__(self, ctx=None, noteId=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None,): self.ctx = ctx self.noteId = noteId self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype481, _size478) = iprot.readListBegin() for _i482 in range(_size478): _elem483 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem483) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype487, _size484) = iprot.readListBegin() for _i488 in range(_size484): _elem489 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem489) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype493, _size490) = iprot.readListBegin() for _i494 in range(_size490): _elem495 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem495) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype499, _size496) = iprot.readListBegin() for _i500 in range(_size496): _elem501 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem501) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('giftBox_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter502 in self.topicList: oprot.writeString(iter502.encode('utf-8') if sys.version_info[0] == 2 else iter502) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter503 in self.titleList: oprot.writeString(iter503.encode('utf-8') if sys.version_info[0] == 2 else iter503) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter504 in self.contentList: oprot.writeString(iter504.encode('utf-8') if sys.version_info[0] == 2 else iter504) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter505 in self.imageList: oprot.writeString(iter505.encode('utf-8') if sys.version_info[0] == 2 else iter505) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(giftBox_args) giftBox_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 ) class giftBox_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GiftBoxResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('giftBox_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(giftBox_result) giftBox_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GiftBoxResult, None], None, ), # 0 ) class giftBoxV2_args(object): """ Attributes: - ctx - noteId - useCache - topicList - titleList - contentList - imageList """ def __init__(self, ctx=None, noteId=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None,): self.ctx = ctx self.noteId = noteId self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype509, _size506) = iprot.readListBegin() for _i510 in range(_size506): _elem511 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem511) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype515, _size512) = iprot.readListBegin() for _i516 in range(_size512): _elem517 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem517) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype521, _size518) = iprot.readListBegin() for _i522 in range(_size518): _elem523 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem523) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype527, _size524) = iprot.readListBegin() for _i528 in range(_size524): _elem529 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem529) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('giftBoxV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter530 in self.topicList: oprot.writeString(iter530.encode('utf-8') if sys.version_info[0] == 2 else iter530) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter531 in self.titleList: oprot.writeString(iter531.encode('utf-8') if sys.version_info[0] == 2 else iter531) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter532 in self.contentList: oprot.writeString(iter532.encode('utf-8') if sys.version_info[0] == 2 else iter532) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter533 in self.imageList: oprot.writeString(iter533.encode('utf-8') if sys.version_info[0] == 2 else iter533) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(giftBoxV2_args) giftBoxV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 ) class giftBoxV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GiftBoxResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('giftBoxV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(giftBoxV2_result) giftBoxV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GiftBoxResult, None], None, ), # 0 ) class fashion_args(object): """ Attributes: - ctx - noteId - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.topicList = [] (_etype537, _size534) = iprot.readListBegin() for _i538 in range(_size534): _elem539 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem539) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.titleList = [] (_etype543, _size540) = iprot.readListBegin() for _i544 in range(_size540): _elem545 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem545) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.contentList = [] (_etype549, _size546) = iprot.readListBegin() for _i550 in range(_size546): _elem551 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem551) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.imageList = [] (_etype555, _size552) = iprot.readListBegin() for _i556 in range(_size552): _elem557 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem557) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.keyFrameList = [] (_etype561, _size558) = iprot.readListBegin() for _i562 in range(_size558): _elem563 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem563) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('fashion_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 3) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter564 in self.topicList: oprot.writeString(iter564.encode('utf-8') if sys.version_info[0] == 2 else iter564) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter565 in self.titleList: oprot.writeString(iter565.encode('utf-8') if sys.version_info[0] == 2 else iter565) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter566 in self.contentList: oprot.writeString(iter566.encode('utf-8') if sys.version_info[0] == 2 else iter566) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter567 in self.imageList: oprot.writeString(iter567.encode('utf-8') if sys.version_info[0] == 2 else iter567) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter568 in self.keyFrameList: oprot.writeString(iter568.encode('utf-8') if sys.version_info[0] == 2 else iter568) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(fashion_args) fashion_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useCache', None, None, ), # 3 (4, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 8 ) class fashion_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.FashionResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('fashion_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(fashion_result) fashion_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.FashionResult, None], None, ), # 0 ) class feedbackClassify_args(object): """ Attributes: - ctx - ticketNo - content - scenarioByUser - categoryByCUser """ def __init__(self, ctx=None, ticketNo=None, content=None, scenarioByUser=None, categoryByCUser=None,): self.ctx = ctx self.ticketNo = ticketNo self.content = content self.scenarioByUser = scenarioByUser self.categoryByCUser = categoryByCUser def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.ticketNo = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.scenarioByUser = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.categoryByCUser = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('feedbackClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.ticketNo is not None: oprot.writeFieldBegin('ticketNo', TType.STRING, 2) oprot.writeString(self.ticketNo.encode('utf-8') if sys.version_info[0] == 2 else self.ticketNo) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() if self.scenarioByUser is not None: oprot.writeFieldBegin('scenarioByUser', TType.STRING, 4) oprot.writeString(self.scenarioByUser.encode('utf-8') if sys.version_info[0] == 2 else self.scenarioByUser) oprot.writeFieldEnd() if self.categoryByCUser is not None: oprot.writeFieldBegin('categoryByCUser', TType.STRING, 5) oprot.writeString(self.categoryByCUser.encode('utf-8') if sys.version_info[0] == 2 else self.categoryByCUser) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.ticketNo is None: raise TProtocolException(message='Required field ticketNo is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') if self.scenarioByUser is None: raise TProtocolException(message='Required field scenarioByUser is unset!') if self.categoryByCUser is None: raise TProtocolException(message='Required field categoryByCUser is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(feedbackClassify_args) feedbackClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'ticketNo', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 (4, TType.STRING, 'scenarioByUser', 'UTF8', None, ), # 4 (5, TType.STRING, 'categoryByCUser', 'UTF8', None, ), # 5 ) class feedbackClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.FeedbackResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('feedbackClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(feedbackClassify_result) feedbackClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.FeedbackResult, None], None, ), # 0 ) class tagClassification_args(object): """ Attributes: - ctx - imgUrl - text """ def __init__(self, ctx=None, imgUrl=None, text=None,): self.ctx = ctx self.imgUrl = imgUrl self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagClassification_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 3) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagClassification_args) tagClassification_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.STRING, 'text', 'UTF8', None, ), # 3 ) class tagClassification_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagClassification_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagClassification_result) tagClassification_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class customerConversationClassify_args(object): """ Attributes: - ctx - caseId - chatId - turns """ def __init__(self, ctx=None, caseId=None, chatId=None, turns=None,): self.ctx = ctx self.caseId = caseId self.chatId = chatId self.turns = turns def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.caseId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.chatId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.turns = [] (_etype572, _size569) = iprot.readListBegin() for _i573 in range(_size569): _elem574 = titancaesar.thrift.caesar.dto.ttypes.CustomerConversationTurn() _elem574.read(iprot) self.turns.append(_elem574) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('customerConversationClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.caseId is not None: oprot.writeFieldBegin('caseId', TType.STRING, 2) oprot.writeString(self.caseId.encode('utf-8') if sys.version_info[0] == 2 else self.caseId) oprot.writeFieldEnd() if self.chatId is not None: oprot.writeFieldBegin('chatId', TType.STRING, 3) oprot.writeString(self.chatId.encode('utf-8') if sys.version_info[0] == 2 else self.chatId) oprot.writeFieldEnd() if self.turns is not None: oprot.writeFieldBegin('turns', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.turns)) for iter575 in self.turns: iter575.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.caseId is None: raise TProtocolException(message='Required field caseId is unset!') if self.chatId is None: raise TProtocolException(message='Required field chatId is unset!') if self.turns is None: raise TProtocolException(message='Required field turns is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(customerConversationClassify_args) customerConversationClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'caseId', 'UTF8', None, ), # 2 (3, TType.STRING, 'chatId', 'UTF8', None, ), # 3 (4, TType.LIST, 'turns', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.CustomerConversationTurn, None], False), None, ), # 4 ) class customerConversationClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('customerConversationClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(customerConversationClassify_result) customerConversationClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class customerConversationClassifyV2_args(object): """ Attributes: - ctx - caseId - chatId - turns """ def __init__(self, ctx=None, caseId=None, chatId=None, turns=None,): self.ctx = ctx self.caseId = caseId self.chatId = chatId self.turns = turns def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.caseId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.chatId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.turns = [] (_etype579, _size576) = iprot.readListBegin() for _i580 in range(_size576): _elem581 = titancaesar.thrift.caesar.dto.ttypes.CustomerConversationTurn() _elem581.read(iprot) self.turns.append(_elem581) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('customerConversationClassifyV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.caseId is not None: oprot.writeFieldBegin('caseId', TType.STRING, 2) oprot.writeString(self.caseId.encode('utf-8') if sys.version_info[0] == 2 else self.caseId) oprot.writeFieldEnd() if self.chatId is not None: oprot.writeFieldBegin('chatId', TType.STRING, 3) oprot.writeString(self.chatId.encode('utf-8') if sys.version_info[0] == 2 else self.chatId) oprot.writeFieldEnd() if self.turns is not None: oprot.writeFieldBegin('turns', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.turns)) for iter582 in self.turns: iter582.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.caseId is None: raise TProtocolException(message='Required field caseId is unset!') if self.chatId is None: raise TProtocolException(message='Required field chatId is unset!') if self.turns is None: raise TProtocolException(message='Required field turns is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(customerConversationClassifyV2_args) customerConversationClassifyV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'caseId', 'UTF8', None, ), # 2 (3, TType.STRING, 'chatId', 'UTF8', None, ), # 3 (4, TType.LIST, 'turns', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.CustomerConversationTurn, None], False), None, ), # 4 ) class customerConversationClassifyV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('customerConversationClassifyV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(customerConversationClassifyV2_result) customerConversationClassifyV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class cover_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cover_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cover_args) cover_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class cover_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cover_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cover_result) cover_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class uncomfortable_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('uncomfortable_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(uncomfortable_args) uncomfortable_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class uncomfortable_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('uncomfortable_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(uncomfortable_result) uncomfortable_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class aestheticAssessment_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aestheticAssessment_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aestheticAssessment_args) aestheticAssessment_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class aestheticAssessment_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.AestheticAssessmentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('aestheticAssessment_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(aestheticAssessment_result) aestheticAssessment_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.AestheticAssessmentResult, None], None, ), # 0 ) class realphoto_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('realphoto_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(realphoto_args) realphoto_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class realphoto_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('realphoto_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(realphoto_result) realphoto_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class ctrEmbedding_args(object): """ Attributes: - ctx - noteId - imgUrls """ def __init__(self, ctx=None, noteId=None, imgUrls=None,): self.ctx = ctx self.noteId = noteId self.imgUrls = imgUrls def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.imgUrls = [] (_etype586, _size583) = iprot.readListBegin() for _i587 in range(_size583): _elem588 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imgUrls.append(_elem588) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.imgUrls)) for iter589 in self.imgUrls: oprot.writeString(iter589.encode('utf-8') if sys.version_info[0] == 2 else iter589) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.imgUrls is None: raise TProtocolException(message='Required field imgUrls is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrEmbedding_args) ctrEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.LIST, 'imgUrls', (TType.STRING, 'UTF8', False), None, ), # 3 ) class ctrEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CtrEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrEmbedding_result) ctrEmbedding_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CtrEmbeddingResult, None], None, ), # 0 ) class ctrForSearch_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrForSearch_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrForSearch_args) ctrForSearch_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class ctrForSearch_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrForSearch_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrForSearch_result) ctrForSearch_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class suspectUser_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.UserClassificationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('suspectUser_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(suspectUser_args) suspectUser_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.UserClassificationRequest, None], None, ), # 2 ) class suspectUser_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('suspectUser_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(suspectUser_result) suspectUser_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class ctrRanking_args(object): """ Attributes: - ctx - noteId - imgUrls """ def __init__(self, ctx=None, noteId=None, imgUrls=None,): self.ctx = ctx self.noteId = noteId self.imgUrls = imgUrls def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.imgUrls = [] (_etype593, _size590) = iprot.readListBegin() for _i594 in range(_size590): _elem595 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imgUrls.append(_elem595) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrRanking_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.imgUrls)) for iter596 in self.imgUrls: oprot.writeString(iter596.encode('utf-8') if sys.version_info[0] == 2 else iter596) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.imgUrls is None: raise TProtocolException(message='Required field imgUrls is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrRanking_args) ctrRanking_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.LIST, 'imgUrls', (TType.STRING, 'UTF8', False), None, ), # 3 ) class ctrRanking_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CtrRankingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ctrRanking_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ctrRanking_result) ctrRanking_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CtrRankingResult, None], None, ), # 0 ) class videoTagging_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype600, _size597) = iprot.readListBegin() for _i601 in range(_size597): _elem602 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem602) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype606, _size603) = iprot.readListBegin() for _i607 in range(_size603): _elem608 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem608) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype612, _size609) = iprot.readListBegin() for _i613 in range(_size609): _elem614 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem614) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype618, _size615) = iprot.readListBegin() for _i619 in range(_size615): _elem620 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem620) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype624, _size621) = iprot.readListBegin() for _i625 in range(_size621): _elem626 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem626) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('videoTagging_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter627 in self.topicList: oprot.writeString(iter627.encode('utf-8') if sys.version_info[0] == 2 else iter627) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter628 in self.titleList: oprot.writeString(iter628.encode('utf-8') if sys.version_info[0] == 2 else iter628) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter629 in self.contentList: oprot.writeString(iter629.encode('utf-8') if sys.version_info[0] == 2 else iter629) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter630 in self.imageList: oprot.writeString(iter630.encode('utf-8') if sys.version_info[0] == 2 else iter630) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter631 in self.keyFrameList: oprot.writeString(iter631.encode('utf-8') if sys.version_info[0] == 2 else iter631) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(videoTagging_args) videoTagging_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class videoTagging_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('videoTagging_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(videoTagging_result) videoTagging_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTopic_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype635, _size632) = iprot.readListBegin() for _i636 in range(_size632): _elem637 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem637) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype641, _size638) = iprot.readListBegin() for _i642 in range(_size638): _elem643 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem643) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype647, _size644) = iprot.readListBegin() for _i648 in range(_size644): _elem649 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem649) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype653, _size650) = iprot.readListBegin() for _i654 in range(_size650): _elem655 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem655) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype659, _size656) = iprot.readListBegin() for _i660 in range(_size656): _elem661 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem661) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopic_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter662 in self.topicList: oprot.writeString(iter662.encode('utf-8') if sys.version_info[0] == 2 else iter662) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter663 in self.titleList: oprot.writeString(iter663.encode('utf-8') if sys.version_info[0] == 2 else iter663) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter664 in self.contentList: oprot.writeString(iter664.encode('utf-8') if sys.version_info[0] == 2 else iter664) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter665 in self.imageList: oprot.writeString(iter665.encode('utf-8') if sys.version_info[0] == 2 else iter665) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter666 in self.keyFrameList: oprot.writeString(iter666.encode('utf-8') if sys.version_info[0] == 2 else iter666) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopic_args) newTopic_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class newTopic_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopic_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopic_result) newTopic_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTopicV2_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype670, _size667) = iprot.readListBegin() for _i671 in range(_size667): _elem672 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem672) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype676, _size673) = iprot.readListBegin() for _i677 in range(_size673): _elem678 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem678) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype682, _size679) = iprot.readListBegin() for _i683 in range(_size679): _elem684 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem684) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype688, _size685) = iprot.readListBegin() for _i689 in range(_size685): _elem690 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem690) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype694, _size691) = iprot.readListBegin() for _i695 in range(_size691): _elem696 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem696) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter697 in self.topicList: oprot.writeString(iter697.encode('utf-8') if sys.version_info[0] == 2 else iter697) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter698 in self.titleList: oprot.writeString(iter698.encode('utf-8') if sys.version_info[0] == 2 else iter698) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter699 in self.contentList: oprot.writeString(iter699.encode('utf-8') if sys.version_info[0] == 2 else iter699) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter700 in self.imageList: oprot.writeString(iter700.encode('utf-8') if sys.version_info[0] == 2 else iter700) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter701 in self.keyFrameList: oprot.writeString(iter701.encode('utf-8') if sys.version_info[0] == 2 else iter701) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicV2_args) newTopicV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class newTopicV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicV2_result) newTopicV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newConceptionV1_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - imageOcrList - videoOcrList - searchTaxonomy1 - searchTaxonomy2 - noteTaxonomy1 - noteTaxonomy2 """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, imageOcrList=None, videoOcrList=None, searchTaxonomy1=None, searchTaxonomy2=None, noteTaxonomy1=None, noteTaxonomy2=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.imageOcrList = imageOcrList self.videoOcrList = videoOcrList self.searchTaxonomy1 = searchTaxonomy1 self.searchTaxonomy2 = searchTaxonomy2 self.noteTaxonomy1 = noteTaxonomy1 self.noteTaxonomy2 = noteTaxonomy2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype705, _size702) = iprot.readListBegin() for _i706 in range(_size702): _elem707 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem707) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype711, _size708) = iprot.readListBegin() for _i712 in range(_size708): _elem713 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem713) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype717, _size714) = iprot.readListBegin() for _i718 in range(_size714): _elem719 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem719) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype723, _size720) = iprot.readListBegin() for _i724 in range(_size720): _elem725 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem725) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype729, _size726) = iprot.readListBegin() for _i730 in range(_size726): _elem731 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem731) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.imageOcrList = [] (_etype735, _size732) = iprot.readListBegin() for _i736 in range(_size732): _elem737 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageOcrList.append(_elem737) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.videoOcrList = [] (_etype741, _size738) = iprot.readListBegin() for _i742 in range(_size738): _elem743 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.videoOcrList.append(_elem743) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.searchTaxonomy1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.searchTaxonomy2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: self.noteTaxonomy1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.STRING: self.noteTaxonomy2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newConceptionV1_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter744 in self.topicList: oprot.writeString(iter744.encode('utf-8') if sys.version_info[0] == 2 else iter744) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter745 in self.titleList: oprot.writeString(iter745.encode('utf-8') if sys.version_info[0] == 2 else iter745) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter746 in self.contentList: oprot.writeString(iter746.encode('utf-8') if sys.version_info[0] == 2 else iter746) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter747 in self.imageList: oprot.writeString(iter747.encode('utf-8') if sys.version_info[0] == 2 else iter747) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter748 in self.keyFrameList: oprot.writeString(iter748.encode('utf-8') if sys.version_info[0] == 2 else iter748) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageOcrList is not None: oprot.writeFieldBegin('imageOcrList', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.imageOcrList)) for iter749 in self.imageOcrList: oprot.writeString(iter749.encode('utf-8') if sys.version_info[0] == 2 else iter749) oprot.writeListEnd() oprot.writeFieldEnd() if self.videoOcrList is not None: oprot.writeFieldBegin('videoOcrList', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.videoOcrList)) for iter750 in self.videoOcrList: oprot.writeString(iter750.encode('utf-8') if sys.version_info[0] == 2 else iter750) oprot.writeListEnd() oprot.writeFieldEnd() if self.searchTaxonomy1 is not None: oprot.writeFieldBegin('searchTaxonomy1', TType.STRING, 12) oprot.writeString(self.searchTaxonomy1.encode('utf-8') if sys.version_info[0] == 2 else self.searchTaxonomy1) oprot.writeFieldEnd() if self.searchTaxonomy2 is not None: oprot.writeFieldBegin('searchTaxonomy2', TType.STRING, 13) oprot.writeString(self.searchTaxonomy2.encode('utf-8') if sys.version_info[0] == 2 else self.searchTaxonomy2) oprot.writeFieldEnd() if self.noteTaxonomy1 is not None: oprot.writeFieldBegin('noteTaxonomy1', TType.STRING, 14) oprot.writeString(self.noteTaxonomy1.encode('utf-8') if sys.version_info[0] == 2 else self.noteTaxonomy1) oprot.writeFieldEnd() if self.noteTaxonomy2 is not None: oprot.writeFieldBegin('noteTaxonomy2', TType.STRING, 15) oprot.writeString(self.noteTaxonomy2.encode('utf-8') if sys.version_info[0] == 2 else self.noteTaxonomy2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') if self.imageOcrList is None: raise TProtocolException(message='Required field imageOcrList is unset!') if self.videoOcrList is None: raise TProtocolException(message='Required field videoOcrList is unset!') if self.searchTaxonomy1 is None: raise TProtocolException(message='Required field searchTaxonomy1 is unset!') if self.searchTaxonomy2 is None: raise TProtocolException(message='Required field searchTaxonomy2 is unset!') if self.noteTaxonomy1 is None: raise TProtocolException(message='Required field noteTaxonomy1 is unset!') if self.noteTaxonomy2 is None: raise TProtocolException(message='Required field noteTaxonomy2 is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newConceptionV1_args) newConceptionV1_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.LIST, 'imageOcrList', (TType.STRING, 'UTF8', False), None, ), # 10 (11, TType.LIST, 'videoOcrList', (TType.STRING, 'UTF8', False), None, ), # 11 (12, TType.STRING, 'searchTaxonomy1', 'UTF8', None, ), # 12 (13, TType.STRING, 'searchTaxonomy2', 'UTF8', None, ), # 13 (14, TType.STRING, 'noteTaxonomy1', 'UTF8', None, ), # 14 (15, TType.STRING, 'noteTaxonomy2', 'UTF8', None, ), # 15 ) class newConceptionV1_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newConceptionV1_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newConceptionV1_result) newConceptionV1_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class newTagV3_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, tax1=None, tax2=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.tax1 = tax1 self.tax2 = tax2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype754, _size751) = iprot.readListBegin() for _i755 in range(_size751): _elem756 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem756) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype760, _size757) = iprot.readListBegin() for _i761 in range(_size757): _elem762 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem762) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype766, _size763) = iprot.readListBegin() for _i767 in range(_size763): _elem768 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem768) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype772, _size769) = iprot.readListBegin() for _i773 in range(_size769): _elem774 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem774) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype778, _size775) = iprot.readListBegin() for _i779 in range(_size775): _elem780 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem780) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: self.tax1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.tax2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTagV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter781 in self.topicList: oprot.writeString(iter781.encode('utf-8') if sys.version_info[0] == 2 else iter781) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter782 in self.titleList: oprot.writeString(iter782.encode('utf-8') if sys.version_info[0] == 2 else iter782) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter783 in self.contentList: oprot.writeString(iter783.encode('utf-8') if sys.version_info[0] == 2 else iter783) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter784 in self.imageList: oprot.writeString(iter784.encode('utf-8') if sys.version_info[0] == 2 else iter784) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter785 in self.keyFrameList: oprot.writeString(iter785.encode('utf-8') if sys.version_info[0] == 2 else iter785) oprot.writeListEnd() oprot.writeFieldEnd() if self.tax1 is not None: oprot.writeFieldBegin('tax1', TType.STRING, 10) oprot.writeString(self.tax1.encode('utf-8') if sys.version_info[0] == 2 else self.tax1) oprot.writeFieldEnd() if self.tax2 is not None: oprot.writeFieldBegin('tax2', TType.STRING, 11) oprot.writeString(self.tax2.encode('utf-8') if sys.version_info[0] == 2 else self.tax2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') if self.tax1 is None: raise TProtocolException(message='Required field tax1 is unset!') if self.tax2 is None: raise TProtocolException(message='Required field tax2 is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTagV3_args) newTagV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.STRING, 'tax1', 'UTF8', None, ), # 10 (11, TType.STRING, 'tax2', 'UTF8', None, ), # 11 ) class newTagV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTagV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTagV3_result) newTagV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTopicPostRule_args(object): """ Attributes: - ctx - noteId - topicList - titleList - contentList - resultList - confList """ def __init__(self, ctx=None, noteId=None, topicList=None, titleList=None, contentList=None, resultList=None, confList=None,): self.ctx = ctx self.noteId = noteId self.topicList = topicList self.titleList = titleList self.contentList = contentList self.resultList = resultList self.confList = confList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.topicList = [] (_etype789, _size786) = iprot.readListBegin() for _i790 in range(_size786): _elem791 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem791) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.titleList = [] (_etype795, _size792) = iprot.readListBegin() for _i796 in range(_size792): _elem797 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem797) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.contentList = [] (_etype801, _size798) = iprot.readListBegin() for _i802 in range(_size798): _elem803 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem803) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.resultList = [] (_etype807, _size804) = iprot.readListBegin() for _i808 in range(_size804): _elem809 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.resultList.append(_elem809) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.confList = [] (_etype813, _size810) = iprot.readListBegin() for _i814 in range(_size810): _elem815 = iprot.readDouble() self.confList.append(_elem815) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicPostRule_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter816 in self.topicList: oprot.writeString(iter816.encode('utf-8') if sys.version_info[0] == 2 else iter816) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter817 in self.titleList: oprot.writeString(iter817.encode('utf-8') if sys.version_info[0] == 2 else iter817) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter818 in self.contentList: oprot.writeString(iter818.encode('utf-8') if sys.version_info[0] == 2 else iter818) oprot.writeListEnd() oprot.writeFieldEnd() if self.resultList is not None: oprot.writeFieldBegin('resultList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.resultList)) for iter819 in self.resultList: oprot.writeString(iter819.encode('utf-8') if sys.version_info[0] == 2 else iter819) oprot.writeListEnd() oprot.writeFieldEnd() if self.confList is not None: oprot.writeFieldBegin('confList', TType.LIST, 7) oprot.writeListBegin(TType.DOUBLE, len(self.confList)) for iter820 in self.confList: oprot.writeDouble(iter820) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.resultList is None: raise TProtocolException(message='Required field resultList is unset!') if self.confList is None: raise TProtocolException(message='Required field confList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicPostRule_args) newTopicPostRule_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'resultList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'confList', (TType.DOUBLE, None, False), None, ), # 7 ) class newTopicPostRule_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicPostRule_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicPostRule_result) newTopicPostRule_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class antiSEOV1_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - query_list - note_tax1_list - note_tax2_list - tag_tax1_list - tag_tax2_list """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, query_list=None, note_tax1_list=None, note_tax2_list=None, tag_tax1_list=None, tag_tax2_list=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.query_list = query_list self.note_tax1_list = note_tax1_list self.note_tax2_list = note_tax2_list self.tag_tax1_list = tag_tax1_list self.tag_tax2_list = tag_tax2_list def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype824, _size821) = iprot.readListBegin() for _i825 in range(_size821): _elem826 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem826) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype830, _size827) = iprot.readListBegin() for _i831 in range(_size827): _elem832 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem832) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype836, _size833) = iprot.readListBegin() for _i837 in range(_size833): _elem838 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem838) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype842, _size839) = iprot.readListBegin() for _i843 in range(_size839): _elem844 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem844) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype848, _size845) = iprot.readListBegin() for _i849 in range(_size845): _elem850 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem850) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.query_list = [] (_etype854, _size851) = iprot.readListBegin() for _i855 in range(_size851): _elem856 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.query_list.append(_elem856) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.note_tax1_list = [] (_etype860, _size857) = iprot.readListBegin() for _i861 in range(_size857): _elem862 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.note_tax1_list.append(_elem862) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.LIST: self.note_tax2_list = [] (_etype866, _size863) = iprot.readListBegin() for _i867 in range(_size863): _elem868 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.note_tax2_list.append(_elem868) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.LIST: self.tag_tax1_list = [] (_etype872, _size869) = iprot.readListBegin() for _i873 in range(_size869): _elem874 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.tag_tax1_list.append(_elem874) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.LIST: self.tag_tax2_list = [] (_etype878, _size875) = iprot.readListBegin() for _i879 in range(_size875): _elem880 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.tag_tax2_list.append(_elem880) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('antiSEOV1_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter881 in self.topicList: oprot.writeString(iter881.encode('utf-8') if sys.version_info[0] == 2 else iter881) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter882 in self.titleList: oprot.writeString(iter882.encode('utf-8') if sys.version_info[0] == 2 else iter882) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter883 in self.contentList: oprot.writeString(iter883.encode('utf-8') if sys.version_info[0] == 2 else iter883) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter884 in self.imageList: oprot.writeString(iter884.encode('utf-8') if sys.version_info[0] == 2 else iter884) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter885 in self.keyFrameList: oprot.writeString(iter885.encode('utf-8') if sys.version_info[0] == 2 else iter885) oprot.writeListEnd() oprot.writeFieldEnd() if self.query_list is not None: oprot.writeFieldBegin('query_list', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.query_list)) for iter886 in self.query_list: oprot.writeString(iter886.encode('utf-8') if sys.version_info[0] == 2 else iter886) oprot.writeListEnd() oprot.writeFieldEnd() if self.note_tax1_list is not None: oprot.writeFieldBegin('note_tax1_list', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.note_tax1_list)) for iter887 in self.note_tax1_list: oprot.writeString(iter887.encode('utf-8') if sys.version_info[0] == 2 else iter887) oprot.writeListEnd() oprot.writeFieldEnd() if self.note_tax2_list is not None: oprot.writeFieldBegin('note_tax2_list', TType.LIST, 12) oprot.writeListBegin(TType.STRING, len(self.note_tax2_list)) for iter888 in self.note_tax2_list: oprot.writeString(iter888.encode('utf-8') if sys.version_info[0] == 2 else iter888) oprot.writeListEnd() oprot.writeFieldEnd() if self.tag_tax1_list is not None: oprot.writeFieldBegin('tag_tax1_list', TType.LIST, 13) oprot.writeListBegin(TType.STRING, len(self.tag_tax1_list)) for iter889 in self.tag_tax1_list: oprot.writeString(iter889.encode('utf-8') if sys.version_info[0] == 2 else iter889) oprot.writeListEnd() oprot.writeFieldEnd() if self.tag_tax2_list is not None: oprot.writeFieldBegin('tag_tax2_list', TType.LIST, 14) oprot.writeListBegin(TType.STRING, len(self.tag_tax2_list)) for iter890 in self.tag_tax2_list: oprot.writeString(iter890.encode('utf-8') if sys.version_info[0] == 2 else iter890) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') if self.query_list is None: raise TProtocolException(message='Required field query_list is unset!') if self.note_tax1_list is None: raise TProtocolException(message='Required field note_tax1_list is unset!') if self.note_tax2_list is None: raise TProtocolException(message='Required field note_tax2_list is unset!') if self.tag_tax1_list is None: raise TProtocolException(message='Required field tag_tax1_list is unset!') if self.tag_tax2_list is None: raise TProtocolException(message='Required field tag_tax2_list is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(antiSEOV1_args) antiSEOV1_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.LIST, 'query_list', (TType.STRING, 'UTF8', False), None, ), # 10 (11, TType.LIST, 'note_tax1_list', (TType.STRING, 'UTF8', False), None, ), # 11 (12, TType.LIST, 'note_tax2_list', (TType.STRING, 'UTF8', False), None, ), # 12 (13, TType.LIST, 'tag_tax1_list', (TType.STRING, 'UTF8', False), None, ), # 13 (14, TType.LIST, 'tag_tax2_list', (TType.STRING, 'UTF8', False), None, ), # 14 ) class antiSEOV1_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('antiSEOV1_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(antiSEOV1_result) antiSEOV1_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTopicWiper_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype894, _size891) = iprot.readListBegin() for _i895 in range(_size891): _elem896 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem896) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype900, _size897) = iprot.readListBegin() for _i901 in range(_size897): _elem902 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem902) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype906, _size903) = iprot.readListBegin() for _i907 in range(_size903): _elem908 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem908) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype912, _size909) = iprot.readListBegin() for _i913 in range(_size909): _elem914 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem914) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype918, _size915) = iprot.readListBegin() for _i919 in range(_size915): _elem920 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem920) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter921 in self.topicList: oprot.writeString(iter921.encode('utf-8') if sys.version_info[0] == 2 else iter921) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter922 in self.titleList: oprot.writeString(iter922.encode('utf-8') if sys.version_info[0] == 2 else iter922) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter923 in self.contentList: oprot.writeString(iter923.encode('utf-8') if sys.version_info[0] == 2 else iter923) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter924 in self.imageList: oprot.writeString(iter924.encode('utf-8') if sys.version_info[0] == 2 else iter924) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter925 in self.keyFrameList: oprot.writeString(iter925.encode('utf-8') if sys.version_info[0] == 2 else iter925) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicWiper_args) newTopicWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class newTopicWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicWiper_result) newTopicWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTopicV2Wiper_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype929, _size926) = iprot.readListBegin() for _i930 in range(_size926): _elem931 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem931) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype935, _size932) = iprot.readListBegin() for _i936 in range(_size932): _elem937 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem937) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype941, _size938) = iprot.readListBegin() for _i942 in range(_size938): _elem943 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem943) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype947, _size944) = iprot.readListBegin() for _i948 in range(_size944): _elem949 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem949) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype953, _size950) = iprot.readListBegin() for _i954 in range(_size950): _elem955 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem955) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicV2Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter956 in self.topicList: oprot.writeString(iter956.encode('utf-8') if sys.version_info[0] == 2 else iter956) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter957 in self.titleList: oprot.writeString(iter957.encode('utf-8') if sys.version_info[0] == 2 else iter957) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter958 in self.contentList: oprot.writeString(iter958.encode('utf-8') if sys.version_info[0] == 2 else iter958) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter959 in self.imageList: oprot.writeString(iter959.encode('utf-8') if sys.version_info[0] == 2 else iter959) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter960 in self.keyFrameList: oprot.writeString(iter960.encode('utf-8') if sys.version_info[0] == 2 else iter960) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicV2Wiper_args) newTopicV2Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class newTopicV2Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTopicV2Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTopicV2Wiper_result) newTopicV2Wiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class newTagV3Wiper_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList - tax1 - tax2 """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None, tax1=None, tax2=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList self.tax1 = tax1 self.tax2 = tax2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype964, _size961) = iprot.readListBegin() for _i965 in range(_size961): _elem966 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem966) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype970, _size967) = iprot.readListBegin() for _i971 in range(_size967): _elem972 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem972) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype976, _size973) = iprot.readListBegin() for _i977 in range(_size973): _elem978 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem978) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype982, _size979) = iprot.readListBegin() for _i983 in range(_size979): _elem984 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem984) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype988, _size985) = iprot.readListBegin() for _i989 in range(_size985): _elem990 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem990) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: self.tax1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.tax2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTagV3Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter991 in self.topicList: oprot.writeString(iter991.encode('utf-8') if sys.version_info[0] == 2 else iter991) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter992 in self.titleList: oprot.writeString(iter992.encode('utf-8') if sys.version_info[0] == 2 else iter992) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter993 in self.contentList: oprot.writeString(iter993.encode('utf-8') if sys.version_info[0] == 2 else iter993) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter994 in self.imageList: oprot.writeString(iter994.encode('utf-8') if sys.version_info[0] == 2 else iter994) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter995 in self.keyFrameList: oprot.writeString(iter995.encode('utf-8') if sys.version_info[0] == 2 else iter995) oprot.writeListEnd() oprot.writeFieldEnd() if self.tax1 is not None: oprot.writeFieldBegin('tax1', TType.STRING, 10) oprot.writeString(self.tax1.encode('utf-8') if sys.version_info[0] == 2 else self.tax1) oprot.writeFieldEnd() if self.tax2 is not None: oprot.writeFieldBegin('tax2', TType.STRING, 11) oprot.writeString(self.tax2.encode('utf-8') if sys.version_info[0] == 2 else self.tax2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.noteType is None: raise TProtocolException(message='Required field noteType is unset!') if self.useCache is None: raise TProtocolException(message='Required field useCache is unset!') if self.topicList is None: raise TProtocolException(message='Required field topicList is unset!') if self.titleList is None: raise TProtocolException(message='Required field titleList is unset!') if self.contentList is None: raise TProtocolException(message='Required field contentList is unset!') if self.imageList is None: raise TProtocolException(message='Required field imageList is unset!') if self.keyFrameList is None: raise TProtocolException(message='Required field keyFrameList is unset!') if self.tax1 is None: raise TProtocolException(message='Required field tax1 is unset!') if self.tax2 is None: raise TProtocolException(message='Required field tax2 is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTagV3Wiper_args) newTagV3Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.STRING, 'tax1', 'UTF8', None, ), # 10 (11, TType.STRING, 'tax2', 'UTF8', None, ), # 11 ) class newTagV3Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('newTagV3Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(newTagV3Wiper_result) newTagV3Wiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.VideoTaggingResult, None], None, ), # 0 ) class cdn2redkvWiper_args(object): """ Attributes: - ctx - note_id_list - note_type_list - image_list_list - key_frame_list_list """ def __init__(self, ctx=None, note_id_list=None, note_type_list=None, image_list_list=None, key_frame_list_list=None,): self.ctx = ctx self.note_id_list = note_id_list self.note_type_list = note_type_list self.image_list_list = image_list_list self.key_frame_list_list = key_frame_list_list def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.note_id_list = [] (_etype999, _size996) = iprot.readListBegin() for _i1000 in range(_size996): _elem1001 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.note_id_list.append(_elem1001) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.note_type_list = [] (_etype1005, _size1002) = iprot.readListBegin() for _i1006 in range(_size1002): _elem1007 = iprot.readI32() self.note_type_list.append(_elem1007) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.image_list_list = [] (_etype1011, _size1008) = iprot.readListBegin() for _i1012 in range(_size1008): _elem1013 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.image_list_list.append(_elem1013) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.key_frame_list_list = [] (_etype1017, _size1014) = iprot.readListBegin() for _i1018 in range(_size1014): _elem1019 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.key_frame_list_list.append(_elem1019) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cdn2redkvWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id_list is not None: oprot.writeFieldBegin('note_id_list', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.note_id_list)) for iter1020 in self.note_id_list: oprot.writeString(iter1020.encode('utf-8') if sys.version_info[0] == 2 else iter1020) oprot.writeListEnd() oprot.writeFieldEnd() if self.note_type_list is not None: oprot.writeFieldBegin('note_type_list', TType.LIST, 3) oprot.writeListBegin(TType.I32, len(self.note_type_list)) for iter1021 in self.note_type_list: oprot.writeI32(iter1021) oprot.writeListEnd() oprot.writeFieldEnd() if self.image_list_list is not None: oprot.writeFieldBegin('image_list_list', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.image_list_list)) for iter1022 in self.image_list_list: oprot.writeString(iter1022.encode('utf-8') if sys.version_info[0] == 2 else iter1022) oprot.writeListEnd() oprot.writeFieldEnd() if self.key_frame_list_list is not None: oprot.writeFieldBegin('key_frame_list_list', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.key_frame_list_list)) for iter1023 in self.key_frame_list_list: oprot.writeString(iter1023.encode('utf-8') if sys.version_info[0] == 2 else iter1023) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id_list is None: raise TProtocolException(message='Required field note_id_list is unset!') if self.note_type_list is None: raise TProtocolException(message='Required field note_type_list is unset!') if self.image_list_list is None: raise TProtocolException(message='Required field image_list_list is unset!') if self.key_frame_list_list is None: raise TProtocolException(message='Required field key_frame_list_list is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cdn2redkvWiper_args) cdn2redkvWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'note_id_list', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.LIST, 'note_type_list', (TType.I32, None, False), None, ), # 3 (4, TType.LIST, 'image_list_list', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.LIST, 'key_frame_list_list', (TType.STRING, 'UTF8', False), None, ), # 5 ) class cdn2redkvWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cdn2redkvWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cdn2redkvWiper_result) cdn2redkvWiper_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class videoEmbedding_args(object): """ Attributes: - ctx - noteId - text - imgUrls """ def __init__(self, ctx=None, noteId=None, text=None, imgUrls=None,): self.ctx = ctx self.noteId = noteId self.text = text self.imgUrls = imgUrls def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.imgUrls = [] (_etype1027, _size1024) = iprot.readListBegin() for _i1028 in range(_size1024): _elem1029 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imgUrls.append(_elem1029) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('videoEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 3) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.imgUrls)) for iter1030 in self.imgUrls: oprot.writeString(iter1030.encode('utf-8') if sys.version_info[0] == 2 else iter1030) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.imgUrls is None: raise TProtocolException(message='Required field imgUrls is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(videoEmbedding_args) videoEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'text', 'UTF8', None, ), # 3 (4, TType.LIST, 'imgUrls', (TType.STRING, 'UTF8', False), None, ), # 4 ) class videoEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1034, _size1031) = iprot.readListBegin() for _i1035 in range(_size1031): _elem1036 = iprot.readDouble() self.success.append(_elem1036) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('videoEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.DOUBLE, len(self.success)) for iter1037 in self.success: oprot.writeDouble(iter1037) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(videoEmbedding_result) videoEmbedding_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 ) class normalEmbedding_args(object): """ Attributes: - ctx - noteId - imgUrls - title - content - huati """ def __init__(self, ctx=None, noteId=None, imgUrls=None, title=None, content=None, huati=None,): self.ctx = ctx self.noteId = noteId self.imgUrls = imgUrls self.title = title self.content = content self.huati = huati def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.imgUrls = [] (_etype1041, _size1038) = iprot.readListBegin() for _i1042 in range(_size1038): _elem1043 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imgUrls.append(_elem1043) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.huati = [] (_etype1047, _size1044) = iprot.readListBegin() for _i1048 in range(_size1044): _elem1049 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.huati.append(_elem1049) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('normalEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.imgUrls is not None: oprot.writeFieldBegin('imgUrls', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.imgUrls)) for iter1050 in self.imgUrls: oprot.writeString(iter1050.encode('utf-8') if sys.version_info[0] == 2 else iter1050) oprot.writeListEnd() oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 4) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 5) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() if self.huati is not None: oprot.writeFieldBegin('huati', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.huati)) for iter1051 in self.huati: oprot.writeString(iter1051.encode('utf-8') if sys.version_info[0] == 2 else iter1051) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.imgUrls is None: raise TProtocolException(message='Required field imgUrls is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') if self.huati is None: raise TProtocolException(message='Required field huati is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(normalEmbedding_args) normalEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.LIST, 'imgUrls', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRING, 'title', 'UTF8', None, ), # 4 (5, TType.STRING, 'content', 'UTF8', None, ), # 5 (6, TType.LIST, 'huati', (TType.STRING, 'UTF8', False), None, ), # 6 ) class normalEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1055, _size1052) = iprot.readListBegin() for _i1056 in range(_size1052): _elem1057 = iprot.readDouble() self.success.append(_elem1057) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('normalEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.DOUBLE, len(self.success)) for iter1058 in self.success: oprot.writeDouble(iter1058) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(normalEmbedding_result) normalEmbedding_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 ) class commentInsult_args(object): """ Attributes: - ctx - text """ def __init__(self, ctx=None, text=None,): self.ctx = ctx self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentInsult_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentInsult_args) commentInsult_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) class commentInsult_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('commentInsult_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(commentInsult_result) commentInsult_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class dishNer_args(object): """ Attributes: - ctx - text """ def __init__(self, ctx=None, text=None,): self.ctx = ctx self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('dishNer_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(dishNer_args) dishNer_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) class dishNer_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1062, _size1059) = iprot.readListBegin() for _i1063 in range(_size1059): _elem1064 = titancaesar.thrift.caesar.dto.ttypes.EntityResult() _elem1064.read(iprot) self.success.append(_elem1064) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('dishNer_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1065 in self.success: iter1065.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(dishNer_result) dishNer_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.EntityResult, None], False), None, ), # 0 ) class detect_args(object): """ Attributes: - ctx - imageUrl """ def __init__(self, ctx=None, imageUrl=None,): self.ctx = ctx self.imageUrl = imageUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imageUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('detect_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imageUrl is not None: oprot.writeFieldBegin('imageUrl', TType.STRING, 2) oprot.writeString(self.imageUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imageUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imageUrl is None: raise TProtocolException(message='Required field imageUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(detect_args) detect_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imageUrl', 'UTF8', None, ), # 2 ) class detect_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1069, _size1066) = iprot.readListBegin() for _i1070 in range(_size1066): _elem1071 = titancaesar.thrift.caesar.dto.ttypes.FaceResult() _elem1071.read(iprot) self.success.append(_elem1071) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('detect_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1072 in self.success: iter1072.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(detect_result) detect_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.FaceResult, None], False), None, ), # 0 ) class faceRecognition_args(object): """ Attributes: - ctx - imgUrl - returnEmbedding """ def __init__(self, ctx=None, imgUrl=None, returnEmbedding=None,): self.ctx = ctx self.imgUrl = imgUrl self.returnEmbedding = returnEmbedding def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.returnEmbedding = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('faceRecognition_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.returnEmbedding is not None: oprot.writeFieldBegin('returnEmbedding', TType.BOOL, 3) oprot.writeBool(self.returnEmbedding) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.returnEmbedding is None: raise TProtocolException(message='Required field returnEmbedding is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(faceRecognition_args) faceRecognition_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.BOOL, 'returnEmbedding', None, None, ), # 3 ) class faceRecognition_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1076, _size1073) = iprot.readListBegin() for _i1077 in range(_size1073): _elem1078 = titancaesar.thrift.caesar.dto.ttypes.FaceRecognitionResult() _elem1078.read(iprot) self.success.append(_elem1078) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('faceRecognition_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1079 in self.success: iter1079.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(faceRecognition_result) faceRecognition_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.FaceRecognitionResult, None], False), None, ), # 0 ) class querySimilarWords_args(object): """ Attributes: - ctx - word - num """ def __init__(self, ctx=None, word=None, num=None,): self.ctx = ctx self.word = word self.num = num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.word = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.num = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('querySimilarWords_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.word is not None: oprot.writeFieldBegin('word', TType.STRING, 2) oprot.writeString(self.word.encode('utf-8') if sys.version_info[0] == 2 else self.word) oprot.writeFieldEnd() if self.num is not None: oprot.writeFieldBegin('num', TType.I32, 3) oprot.writeI32(self.num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.word is None: raise TProtocolException(message='Required field word is unset!') if self.num is None: raise TProtocolException(message='Required field num is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(querySimilarWords_args) querySimilarWords_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'word', 'UTF8', None, ), # 2 (3, TType.I32, 'num', None, None, ), # 3 ) class querySimilarWords_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1083, _size1080) = iprot.readListBegin() for _i1084 in range(_size1080): _elem1085 = titancaesar.thrift.caesar.dto.ttypes.SimilarWord() _elem1085.read(iprot) self.success.append(_elem1085) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('querySimilarWords_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1086 in self.success: iter1086.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(querySimilarWords_result) querySimilarWords_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.SimilarWord, None], False), None, ), # 0 ) class getSimilarity_args(object): """ Attributes: - ctx - word1 - word2 """ def __init__(self, ctx=None, word1=None, word2=None,): self.ctx = ctx self.word1 = word1 self.word2 = word2 def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.word1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.word2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getSimilarity_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.word1 is not None: oprot.writeFieldBegin('word1', TType.STRING, 2) oprot.writeString(self.word1.encode('utf-8') if sys.version_info[0] == 2 else self.word1) oprot.writeFieldEnd() if self.word2 is not None: oprot.writeFieldBegin('word2', TType.STRING, 3) oprot.writeString(self.word2.encode('utf-8') if sys.version_info[0] == 2 else self.word2) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.word1 is None: raise TProtocolException(message='Required field word1 is unset!') if self.word2 is None: raise TProtocolException(message='Required field word2 is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getSimilarity_args) getSimilarity_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'word1', 'UTF8', None, ), # 2 (3, TType.STRING, 'word2', 'UTF8', None, ), # 3 ) class getSimilarity_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getSimilarity_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getSimilarity_result) getSimilarity_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class isDupPoi_args(object): """ Attributes: - ctx - vec - category """ def __init__(self, ctx=None, vec=None, category=None,): self.ctx = ctx self.vec = vec self.category = category def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.vec = [] (_etype1090, _size1087) = iprot.readListBegin() for _i1091 in range(_size1087): _elem1092 = [] (_etype1096, _size1093) = iprot.readListBegin() for _i1097 in range(_size1093): _elem1098 = iprot.readDouble() _elem1092.append(_elem1098) iprot.readListEnd() self.vec.append(_elem1092) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.category = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('isDupPoi_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.vec is not None: oprot.writeFieldBegin('vec', TType.LIST, 2) oprot.writeListBegin(TType.LIST, len(self.vec)) for iter1099 in self.vec: oprot.writeListBegin(TType.DOUBLE, len(iter1099)) for iter1100 in iter1099: oprot.writeDouble(iter1100) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() if self.category is not None: oprot.writeFieldBegin('category', TType.I32, 3) oprot.writeI32(self.category) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.vec is None: raise TProtocolException(message='Required field vec is unset!') if self.category is None: raise TProtocolException(message='Required field category is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(isDupPoi_args) isDupPoi_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'vec', (TType.LIST, (TType.DOUBLE, None, False), False), None, ), # 2 (3, TType.I32, 'category', None, None, ), # 3 ) class isDupPoi_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1104, _size1101) = iprot.readListBegin() for _i1105 in range(_size1101): _elem1106 = iprot.readDouble() self.success.append(_elem1106) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('isDupPoi_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.DOUBLE, len(self.success)) for iter1107 in self.success: oprot.writeDouble(iter1107) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(isDupPoi_result) isDupPoi_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 ) class musicDssmEmbedding_args(object): """ Attributes: - ctx - imgUrl - topK """ def __init__(self, ctx=None, imgUrl=None, topK=None,): self.ctx = ctx self.imgUrl = imgUrl self.topK = topK def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.topK = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('musicDssmEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.topK is not None: oprot.writeFieldBegin('topK', TType.I32, 3) oprot.writeI32(self.topK) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.topK is None: raise TProtocolException(message='Required field topK is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(musicDssmEmbedding_args) musicDssmEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.I32, 'topK', None, None, ), # 3 ) class musicDssmEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1111, _size1108) = iprot.readListBegin() for _i1112 in range(_size1108): _elem1113 = titancaesar.thrift.caesar.dto.ttypes.MusicRec() _elem1113.read(iprot) self.success.append(_elem1113) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('musicDssmEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1114 in self.success: iter1114.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(musicDssmEmbedding_result) musicDssmEmbedding_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.MusicRec, None], False), None, ), # 0 ) class getImageClassification_args(object): """ Attributes: - ctx - imgUrl - modelType """ def __init__(self, ctx=None, imgUrl=None, modelType=None,): self.ctx = ctx self.imgUrl = imgUrl self.modelType = modelType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.modelType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getImageClassification_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.modelType is not None: oprot.writeFieldBegin('modelType', TType.STRING, 3) oprot.writeString(self.modelType.encode('utf-8') if sys.version_info[0] == 2 else self.modelType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.modelType is None: raise TProtocolException(message='Required field modelType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getImageClassification_args) getImageClassification_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.STRING, 'modelType', 'UTF8', None, ), # 3 ) class getImageClassification_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1118, _size1115) = iprot.readListBegin() for _i1119 in range(_size1115): _elem1120 = titancaesar.thrift.caesar.dto.ttypes.ImageClassificationResult() _elem1120.read(iprot) self.success.append(_elem1120) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getImageClassification_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1121 in self.success: iter1121.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getImageClassification_result) getImageClassification_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.ImageClassificationResult, None], False), None, ), # 0 ) class isDupSpvV1_args(object): """ Attributes: - ctx - leftName - rightName - featureStr """ def __init__(self, ctx=None, leftName=None, rightName=None, featureStr=None,): self.ctx = ctx self.leftName = leftName self.rightName = rightName self.featureStr = featureStr def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.leftName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.rightName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.featureStr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('isDupSpvV1_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.leftName is not None: oprot.writeFieldBegin('leftName', TType.STRING, 2) oprot.writeString(self.leftName.encode('utf-8') if sys.version_info[0] == 2 else self.leftName) oprot.writeFieldEnd() if self.rightName is not None: oprot.writeFieldBegin('rightName', TType.STRING, 3) oprot.writeString(self.rightName.encode('utf-8') if sys.version_info[0] == 2 else self.rightName) oprot.writeFieldEnd() if self.featureStr is not None: oprot.writeFieldBegin('featureStr', TType.STRING, 4) oprot.writeString(self.featureStr.encode('utf-8') if sys.version_info[0] == 2 else self.featureStr) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.leftName is None: raise TProtocolException(message='Required field leftName is unset!') if self.rightName is None: raise TProtocolException(message='Required field rightName is unset!') if self.featureStr is None: raise TProtocolException(message='Required field featureStr is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(isDupSpvV1_args) isDupSpvV1_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'leftName', 'UTF8', None, ), # 2 (3, TType.STRING, 'rightName', 'UTF8', None, ), # 3 (4, TType.STRING, 'featureStr', 'UTF8', None, ), # 4 ) class isDupSpvV1_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype1123, _vtype1124, _size1122) = iprot.readMapBegin() for _i1126 in range(_size1122): _key1127 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1128 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success[_key1127] = _val1128 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('isDupSpvV1_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) for kiter1129, viter1130 in self.success.items(): oprot.writeString(kiter1129.encode('utf-8') if sys.version_info[0] == 2 else kiter1129) oprot.writeString(viter1130.encode('utf-8') if sys.version_info[0] == 2 else viter1130) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(isDupSpvV1_result) isDupSpvV1_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 ) class sentimentAnalysis_args(object): """ Attributes: - ctx - text """ def __init__(self, ctx=None, text=None,): self.ctx = ctx self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentimentAnalysis_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 2) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentimentAnalysis_args) sentimentAnalysis_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'text', 'UTF8', None, ), # 2 ) class sentimentAnalysis_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1134, _size1131) = iprot.readListBegin() for _i1135 in range(_size1131): _elem1136 = iprot.readDouble() self.success.append(_elem1136) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentimentAnalysis_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.DOUBLE, len(self.success)) for iter1137 in self.success: oprot.writeDouble(iter1137) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentimentAnalysis_result) sentimentAnalysis_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 ) class topicDssmEmbedding_args(object): """ Attributes: - ctx - title - content - imgUrl """ def __init__(self, ctx=None, title=None, content=None, imgUrl=None,): self.ctx = ctx self.title = title self.content = content self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('topicDssmEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 2) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 4) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(topicDssmEmbedding_args) topicDssmEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'title', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 (4, TType.STRING, 'imgUrl', 'UTF8', None, ), # 4 ) class topicDssmEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1141, _size1138) = iprot.readListBegin() for _i1142 in range(_size1138): _elem1143 = iprot.readDouble() self.success.append(_elem1143) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('topicDssmEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.DOUBLE, len(self.success)) for iter1144 in self.success: oprot.writeDouble(iter1144) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(topicDssmEmbedding_result) topicDssmEmbedding_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 ) class splitSentence_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1148, _size1145) = iprot.readListBegin() for _i1149 in range(_size1145): _elem1150 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1150) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('splitSentence_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1151 in self.texts: oprot.writeString(iter1151.encode('utf-8') if sys.version_info[0] == 2 else iter1151) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(splitSentence_args) splitSentence_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class splitSentence_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1155, _size1152) = iprot.readListBegin() for _i1156 in range(_size1152): _elem1157 = [] (_etype1161, _size1158) = iprot.readListBegin() for _i1162 in range(_size1158): _elem1163 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _elem1157.append(_elem1163) iprot.readListEnd() self.success.append(_elem1157) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('splitSentence_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.LIST, len(self.success)) for iter1164 in self.success: oprot.writeListBegin(TType.STRING, len(iter1164)) for iter1165 in iter1164: oprot.writeString(iter1165.encode('utf-8') if sys.version_info[0] == 2 else iter1165) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(splitSentence_result) splitSentence_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 0 ) class universalNer_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1169, _size1166) = iprot.readListBegin() for _i1170 in range(_size1166): _elem1171 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1171) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNer_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1172 in self.texts: oprot.writeString(iter1172.encode('utf-8') if sys.version_info[0] == 2 else iter1172) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNer_args) universalNer_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class universalNer_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1176, _size1173) = iprot.readListBegin() for _i1177 in range(_size1173): _elem1178 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem1178) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNer_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter1179 in self.success: oprot.writeString(iter1179.encode('utf-8') if sys.version_info[0] == 2 else iter1179) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNer_result) universalNer_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 ) class universalNerV2_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1183, _size1180) = iprot.readListBegin() for _i1184 in range(_size1180): _elem1185 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1185) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNerV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1186 in self.texts: oprot.writeString(iter1186.encode('utf-8') if sys.version_info[0] == 2 else iter1186) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNerV2_args) universalNerV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class universalNerV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1190, _size1187) = iprot.readListBegin() for _i1191 in range(_size1187): _elem1192 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem1192) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNerV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter1193 in self.success: oprot.writeString(iter1193.encode('utf-8') if sys.version_info[0] == 2 else iter1193) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNerV2_result) universalNerV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 ) class universalNerV3_args(object): """ Attributes: - ctx - texts - types """ def __init__(self, ctx=None, texts=None, types=None,): self.ctx = ctx self.texts = texts self.types = types def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1197, _size1194) = iprot.readListBegin() for _i1198 in range(_size1194): _elem1199 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1199) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.types = [] (_etype1203, _size1200) = iprot.readListBegin() for _i1204 in range(_size1200): _elem1205 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.types.append(_elem1205) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNerV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1206 in self.texts: oprot.writeString(iter1206.encode('utf-8') if sys.version_info[0] == 2 else iter1206) oprot.writeListEnd() oprot.writeFieldEnd() if self.types is not None: oprot.writeFieldBegin('types', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.types)) for iter1207 in self.types: oprot.writeString(iter1207.encode('utf-8') if sys.version_info[0] == 2 else iter1207) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') if self.types is None: raise TProtocolException(message='Required field types is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNerV3_args) universalNerV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.LIST, 'types', (TType.STRING, 'UTF8', False), None, ), # 3 ) class universalNerV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1211, _size1208) = iprot.readListBegin() for _i1212 in range(_size1208): _elem1213 = titancaesar.thrift.caesar.dto.ttypes.NERResult() _elem1213.read(iprot) self.success.append(_elem1213) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('universalNerV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1214 in self.success: iter1214.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(universalNerV3_result) universalNerV3_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.NERResult, None], False), None, ), # 0 ) class brandClassify_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1218, _size1215) = iprot.readListBegin() for _i1219 in range(_size1215): _elem1220 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1220) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('brandClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1221 in self.texts: oprot.writeString(iter1221.encode('utf-8') if sys.version_info[0] == 2 else iter1221) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(brandClassify_args) brandClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class brandClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1225, _size1222) = iprot.readListBegin() for _i1226 in range(_size1222): _elem1227 = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() _elem1227.read(iprot) self.success.append(_elem1227) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('brandClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1228 in self.success: iter1228.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(brandClassify_result) brandClassify_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], False), None, ), # 0 ) class brandClassifyV2_args(object): """ Attributes: - ctx - brandNames - title - content """ def __init__(self, ctx=None, brandNames=None, title=None, content=None,): self.ctx = ctx self.brandNames = brandNames self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.brandNames = [] (_etype1232, _size1229) = iprot.readListBegin() for _i1233 in range(_size1229): _elem1234 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.brandNames.append(_elem1234) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('brandClassifyV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.brandNames is not None: oprot.writeFieldBegin('brandNames', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.brandNames)) for iter1235 in self.brandNames: oprot.writeString(iter1235.encode('utf-8') if sys.version_info[0] == 2 else iter1235) oprot.writeListEnd() oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 3) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 4) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.brandNames is None: raise TProtocolException(message='Required field brandNames is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(brandClassifyV2_args) brandClassifyV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'brandNames', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.STRING, 'title', 'UTF8', None, ), # 3 (4, TType.STRING, 'content', 'UTF8', None, ), # 4 ) class brandClassifyV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.BrandClassifyResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('brandClassifyV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(brandClassifyV2_result) brandClassifyV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.BrandClassifyResult, None], None, ), # 0 ) class timeSensitiveClassify_args(object): """ Attributes: - ctx - title - content """ def __init__(self, ctx=None, title=None, content=None,): self.ctx = ctx self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('timeSensitiveClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 2) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 3) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(timeSensitiveClassify_args) timeSensitiveClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'title', 'UTF8', None, ), # 2 (3, TType.STRING, 'content', 'UTF8', None, ), # 3 ) class timeSensitiveClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('timeSensitiveClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(timeSensitiveClassify_result) timeSensitiveClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ClassifyAlgoResult, None], None, ), # 0 ) class whiteBoxCartoonize_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('whiteBoxCartoonize_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(whiteBoxCartoonize_args) whiteBoxCartoonize_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class whiteBoxCartoonize_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('whiteBoxCartoonize_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(whiteBoxCartoonize_result) whiteBoxCartoonize_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class superResolution_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('superResolution_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(superResolution_args) superResolution_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class superResolution_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('superResolution_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(superResolution_result) superResolution_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class noteEcology_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.EcologyRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEcology_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEcology_args) noteEcology_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.EcologyRequest, None], None, ), # 2 ) class noteEcology_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EcologyResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEcology_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEcology_result) noteEcology_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EcologyResult, None], None, ), # 0 ) class noteQuality_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.EcologyRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteQuality_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteQuality_args) noteQuality_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.EcologyRequest, None], None, ), # 2 ) class noteQuality_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteQuality_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteQuality_result) noteQuality_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class noteQualityV5_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.EcologyRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteQualityV5_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteQualityV5_args) noteQualityV5_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.EcologyRequest, None], None, ), # 2 ) class noteQualityV5_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.DOUBLE: self.success = iprot.readDouble() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteQualityV5_result') if self.success is not None: oprot.writeFieldBegin('success', TType.DOUBLE, 0) oprot.writeDouble(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteQualityV5_result) noteQualityV5_result.thrift_spec = ( (0, TType.DOUBLE, 'success', None, None, ), # 0 ) class petDetection_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('petDetection_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(petDetection_args) petDetection_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class petDetection_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1239, _size1236) = iprot.readListBegin() for _i1240 in range(_size1236): _elem1241 = titancaesar.thrift.caesar.dto.ttypes.BboxResult() _elem1241.read(iprot) self.success.append(_elem1241) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('petDetection_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1242 in self.success: iter1242.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(petDetection_result) petDetection_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.BboxResult, None], False), None, ), # 0 ) class tagCorrelation_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.TagCorrelationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagCorrelation_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagCorrelation_args) tagCorrelation_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.TagCorrelationRequest, None], None, ), # 2 ) class tagCorrelation_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.TagCorrelationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagCorrelation_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagCorrelation_result) tagCorrelation_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.TagCorrelationResult, None], None, ), # 0 ) class tagCorrelationV2_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.TagCorrelationRequestV2() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagCorrelationV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagCorrelationV2_args) tagCorrelationV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.TagCorrelationRequestV2, None], None, ), # 2 ) class tagCorrelationV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.TagCorrelationResultV2() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('tagCorrelationV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(tagCorrelationV2_result) tagCorrelationV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.TagCorrelationResultV2, None], None, ), # 0 ) class searchDetection_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchDetection_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchDetection_args) searchDetection_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class searchDetection_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.SearchDetectionResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchDetection_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchDetection_result) searchDetection_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.SearchDetectionResult, None], None, ), # 0 ) class searchOfflineDetection_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchOfflineDetection_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchOfflineDetection_args) searchOfflineDetection_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class searchOfflineDetection_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.SearchDetectionResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchOfflineDetection_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchOfflineDetection_result) searchOfflineDetection_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.SearchDetectionResult, None], None, ), # 0 ) class searchEmbedding_args(object): """ Attributes: - ctx - imgUrl - box """ def __init__(self, ctx=None, imgUrl=None, box=None,): self.ctx = ctx self.imgUrl = imgUrl self.box = box def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.box = [] (_etype1246, _size1243) = iprot.readListBegin() for _i1247 in range(_size1243): _elem1248 = iprot.readDouble() self.box.append(_elem1248) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.box is not None: oprot.writeFieldBegin('box', TType.LIST, 3) oprot.writeListBegin(TType.DOUBLE, len(self.box)) for iter1249 in self.box: oprot.writeDouble(iter1249) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.box is None: raise TProtocolException(message='Required field box is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchEmbedding_args) searchEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.LIST, 'box', (TType.DOUBLE, None, False), None, ), # 3 ) class searchEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.SearchEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchEmbedding_result) searchEmbedding_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.SearchEmbeddingResult, None], None, ), # 0 ) class searchClassification_args(object): """ Attributes: - ctx - imgUrl - box """ def __init__(self, ctx=None, imgUrl=None, box=None,): self.ctx = ctx self.imgUrl = imgUrl self.box = box def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.box = [] (_etype1253, _size1250) = iprot.readListBegin() for _i1254 in range(_size1250): _elem1255 = iprot.readDouble() self.box.append(_elem1255) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchClassification_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.box is not None: oprot.writeFieldBegin('box', TType.LIST, 3) oprot.writeListBegin(TType.DOUBLE, len(self.box)) for iter1256 in self.box: oprot.writeDouble(iter1256) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.box is None: raise TProtocolException(message='Required field box is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchClassification_args) searchClassification_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.LIST, 'box', (TType.DOUBLE, None, False), None, ), # 3 ) class searchClassification_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.SearchClassificationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchClassification_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchClassification_result) searchClassification_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.SearchClassificationResult, None], None, ), # 0 ) class searchClassificationOffline_args(object): """ Attributes: - ctx - imgUrl - box """ def __init__(self, ctx=None, imgUrl=None, box=None,): self.ctx = ctx self.imgUrl = imgUrl self.box = box def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.box = [] (_etype1260, _size1257) = iprot.readListBegin() for _i1261 in range(_size1257): _elem1262 = iprot.readDouble() self.box.append(_elem1262) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchClassificationOffline_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.box is not None: oprot.writeFieldBegin('box', TType.LIST, 3) oprot.writeListBegin(TType.DOUBLE, len(self.box)) for iter1263 in self.box: oprot.writeDouble(iter1263) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.box is None: raise TProtocolException(message='Required field box is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchClassificationOffline_args) searchClassificationOffline_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.LIST, 'box', (TType.DOUBLE, None, False), None, ), # 3 ) class searchClassificationOffline_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.SearchClassificationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchClassificationOffline_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchClassificationOffline_result) searchClassificationOffline_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.SearchClassificationResult, None], None, ), # 0 ) class searchPipeline_args(object): """ Attributes: - ctx - imgUrl - useClassification """ def __init__(self, ctx=None, imgUrl=None, useClassification=None,): self.ctx = ctx self.imgUrl = imgUrl self.useClassification = useClassification def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useClassification = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchPipeline_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.useClassification is not None: oprot.writeFieldBegin('useClassification', TType.BOOL, 3) oprot.writeBool(self.useClassification) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.useClassification is None: raise TProtocolException(message='Required field useClassification is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchPipeline_args) searchPipeline_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useClassification', None, None, ), # 3 ) class searchPipeline_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1267, _size1264) = iprot.readListBegin() for _i1268 in range(_size1264): _elem1269 = titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResult() _elem1269.read(iprot) self.success.append(_elem1269) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchPipeline_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1270 in self.success: iter1270.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchPipeline_result) searchPipeline_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResult, None], False), None, ), # 0 ) class searchOfflinePipeline_args(object): """ Attributes: - ctx - imgUrl - useClassification """ def __init__(self, ctx=None, imgUrl=None, useClassification=None,): self.ctx = ctx self.imgUrl = imgUrl self.useClassification = useClassification def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.useClassification = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchOfflinePipeline_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() if self.useClassification is not None: oprot.writeFieldBegin('useClassification', TType.BOOL, 3) oprot.writeBool(self.useClassification) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') if self.useClassification is None: raise TProtocolException(message='Required field useClassification is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchOfflinePipeline_args) searchOfflinePipeline_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 (3, TType.BOOL, 'useClassification', None, None, ), # 3 ) class searchOfflinePipeline_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1274, _size1271) = iprot.readListBegin() for _i1275 in range(_size1271): _elem1276 = titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResult() _elem1276.read(iprot) self.success.append(_elem1276) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchOfflinePipeline_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1277 in self.success: iter1277.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchOfflinePipeline_result) searchOfflinePipeline_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResult, None], False), None, ), # 0 ) class searchRedCloudPipeline_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchRedCloudPipeline_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchRedCloudPipeline_args) searchRedCloudPipeline_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class searchRedCloudPipeline_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1281, _size1278) = iprot.readListBegin() for _i1282 in range(_size1278): _elem1283 = titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResultRedCloud() _elem1283.read(iprot) self.success.append(_elem1283) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchRedCloudPipeline_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1284 in self.success: iter1284.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchRedCloudPipeline_result) searchRedCloudPipeline_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResultRedCloud, None], False), None, ), # 0 ) class searchGisRedCloudPipeline_args(object): """ Attributes: - ctx - imgUrl """ def __init__(self, ctx=None, imgUrl=None,): self.ctx = ctx self.imgUrl = imgUrl def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.imgUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchGisRedCloudPipeline_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.imgUrl is not None: oprot.writeFieldBegin('imgUrl', TType.STRING, 2) oprot.writeString(self.imgUrl.encode('utf-8') if sys.version_info[0] == 2 else self.imgUrl) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.imgUrl is None: raise TProtocolException(message='Required field imgUrl is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchGisRedCloudPipeline_args) searchGisRedCloudPipeline_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'imgUrl', 'UTF8', None, ), # 2 ) class searchGisRedCloudPipeline_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1288, _size1285) = iprot.readListBegin() for _i1289 in range(_size1285): _elem1290 = titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResultRedCloud() _elem1290.read(iprot) self.success.append(_elem1290) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('searchGisRedCloudPipeline_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1291 in self.success: iter1291.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(searchGisRedCloudPipeline_result) searchGisRedCloudPipeline_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.SearchBoxInfoResultRedCloud, None], False), None, ), # 0 ) class noteStructure_args(object): """ Attributes: - ctx - cate - text """ def __init__(self, ctx=None, cate=None, text=None,): self.ctx = ctx self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteStructure_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 2) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 3) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteStructure_args) noteStructure_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'cate', 'UTF8', None, ), # 2 (3, TType.STRING, 'text', 'UTF8', None, ), # 3 ) class noteStructure_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1295, _size1292) = iprot.readListBegin() for _i1296 in range(_size1292): _elem1297 = titancaesar.thrift.caesar.dto.ttypes.NoteStructureResult() _elem1297.read(iprot) self.success.append(_elem1297) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteStructure_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1298 in self.success: iter1298.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteStructure_result) noteStructure_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.NoteStructureResult, None], False), None, ), # 0 ) class baikeEntityLink_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1302, _size1299) = iprot.readListBegin() for _i1303 in range(_size1299): _elem1304 = titancaesar.thrift.caesar.dto.ttypes.BaikeEntityLinkFeat() _elem1304.read(iprot) self.candidate.append(_elem1304) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeEntityLink_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1305 in self.candidate: iter1305.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeEntityLink_args) baikeEntityLink_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.BaikeEntityLinkFeat, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class baikeEntityLink_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeEntityLink_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeEntityLink_result) baikeEntityLink_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult, None], None, ), # 0 ) class baikeEntityLinkWiper_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1309, _size1306) = iprot.readListBegin() for _i1310 in range(_size1306): _elem1311 = titancaesar.thrift.caesar.dto.ttypes.BaikeEntityLinkFeat() _elem1311.read(iprot) self.candidate.append(_elem1311) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeEntityLinkWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1312 in self.candidate: iter1312.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeEntityLinkWiper_args) baikeEntityLinkWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.BaikeEntityLinkFeat, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class baikeEntityLinkWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeEntityLinkWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeEntityLinkWiper_result) baikeEntityLinkWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult, None], None, ), # 0 ) class poiLinkRank_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1316, _size1313) = iprot.readListBegin() for _i1317 in range(_size1313): _elem1318 = titancaesar.thrift.caesar.dto.ttypes.poiLinkRankFeat() _elem1318.read(iprot) self.candidate.append(_elem1318) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('poiLinkRank_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1319 in self.candidate: iter1319.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(poiLinkRank_args) poiLinkRank_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.poiLinkRankFeat, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class poiLinkRank_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('poiLinkRank_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(poiLinkRank_result) poiLinkRank_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult, None], None, ), # 0 ) class noteCategoryLink_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1323, _size1320) = iprot.readListBegin() for _i1324 in range(_size1320): _elem1325 = titancaesar.thrift.caesar.dto.ttypes.NoteCategoryLinkCandidate() _elem1325.read(iprot) self.candidate.append(_elem1325) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteCategoryLink_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1326 in self.candidate: iter1326.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteCategoryLink_args) noteCategoryLink_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.NoteCategoryLinkCandidate, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class noteCategoryLink_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteCategoryLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteCategoryLink_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteCategoryLink_result) noteCategoryLink_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteCategoryLinkResult, None], None, ), # 0 ) class goodsSpuLink_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1330, _size1327) = iprot.readListBegin() for _i1331 in range(_size1327): _elem1332 = titancaesar.thrift.caesar.dto.ttypes.GoodsSpuLinkCandidate() _elem1332.read(iprot) self.candidate.append(_elem1332) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('goodsSpuLink_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1333 in self.candidate: iter1333.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(goodsSpuLink_args) goodsSpuLink_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GoodsSpuLinkCandidate, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class goodsSpuLink_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('goodsSpuLink_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(goodsSpuLink_result) goodsSpuLink_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult, None], None, ), # 0 ) class goodsSpuLinkWiper_args(object): """ Attributes: - ctx - noteId - mention - context - candidate - mentionType """ def __init__(self, ctx=None, noteId=None, mention=None, context=None, candidate=None, mentionType=None,): self.ctx = ctx self.noteId = noteId self.mention = mention self.context = context self.candidate = candidate self.mentionType = mentionType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.mention = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.candidate = [] (_etype1337, _size1334) = iprot.readListBegin() for _i1338 in range(_size1334): _elem1339 = titancaesar.thrift.caesar.dto.ttypes.GoodsSpuLinkCandidate() _elem1339.read(iprot) self.candidate.append(_elem1339) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.mentionType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('goodsSpuLinkWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.mention is not None: oprot.writeFieldBegin('mention', TType.STRING, 3) oprot.writeString(self.mention.encode('utf-8') if sys.version_info[0] == 2 else self.mention) oprot.writeFieldEnd() if self.context is not None: oprot.writeFieldBegin('context', TType.STRING, 4) oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context) oprot.writeFieldEnd() if self.candidate is not None: oprot.writeFieldBegin('candidate', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.candidate)) for iter1340 in self.candidate: iter1340.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.mentionType is not None: oprot.writeFieldBegin('mentionType', TType.STRING, 6) oprot.writeString(self.mentionType.encode('utf-8') if sys.version_info[0] == 2 else self.mentionType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.noteId is None: raise TProtocolException(message='Required field noteId is unset!') if self.mention is None: raise TProtocolException(message='Required field mention is unset!') if self.context is None: raise TProtocolException(message='Required field context is unset!') if self.candidate is None: raise TProtocolException(message='Required field candidate is unset!') if self.mentionType is None: raise TProtocolException(message='Required field mentionType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(goodsSpuLinkWiper_args) goodsSpuLinkWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.STRING, 'mention', 'UTF8', None, ), # 3 (4, TType.STRING, 'context', 'UTF8', None, ), # 4 (5, TType.LIST, 'candidate', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GoodsSpuLinkCandidate, None], False), None, ), # 5 (6, TType.STRING, 'mentionType', 'UTF8', None, ), # 6 ) class goodsSpuLinkWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('goodsSpuLinkWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(goodsSpuLinkWiper_result) goodsSpuLinkWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.EntityLinkResult, None], None, ), # 0 ) class generalEntityExtract_args(object): """ Attributes: - ctx - note_id - cate - text """ def __init__(self, ctx=None, note_id=None, cate=None, text=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtract_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtract_args) generalEntityExtract_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 ) class generalEntityExtract_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtract_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtract_result) generalEntityExtract_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class generalEntityExtractV2_args(object): """ Attributes: - ctx - note_id - cate - text """ def __init__(self, ctx=None, note_id=None, cate=None, text=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV2_args) generalEntityExtractV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 ) class generalEntityExtractV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV2_result) generalEntityExtractV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class generalEntityExtractV3_args(object): """ Attributes: - ctx - note_id - cate - text """ def __init__(self, ctx=None, note_id=None, cate=None, text=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV3_args) generalEntityExtractV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 ) class generalEntityExtractV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV3_result) generalEntityExtractV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class generalEntityExtractV4_args(object): """ Attributes: - ctx - note_id - cate - texts """ def __init__(self, ctx=None, note_id=None, cate=None, texts=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.texts = {} (_ktype1342, _vtype1343, _size1341) = iprot.readMapBegin() for _i1345 in range(_size1341): _key1346 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1347 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts[_key1346] = _val1347 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.texts)) for kiter1348, viter1349 in self.texts.items(): oprot.writeString(kiter1348.encode('utf-8') if sys.version_info[0] == 2 else kiter1348) oprot.writeString(viter1349.encode('utf-8') if sys.version_info[0] == 2 else viter1349) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV4_args) generalEntityExtractV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.MAP, 'texts', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 ) class generalEntityExtractV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype1351, _vtype1352, _size1350) = iprot.readMapBegin() for _i1354 in range(_size1350): _key1355 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1356 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1356.read(iprot) self.success[_key1355] = _val1356 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) for kiter1357, viter1358 in self.success.items(): oprot.writeString(kiter1357.encode('utf-8') if sys.version_info[0] == 2 else kiter1357) viter1358.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV4_result) generalEntityExtractV4_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 0 ) class generalEntityExtractV4Wiper_args(object): """ Attributes: - ctx - note_id - cate - texts """ def __init__(self, ctx=None, note_id=None, cate=None, texts=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.texts = {} (_ktype1360, _vtype1361, _size1359) = iprot.readMapBegin() for _i1363 in range(_size1359): _key1364 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1365 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts[_key1364] = _val1365 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV4Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.texts)) for kiter1366, viter1367 in self.texts.items(): oprot.writeString(kiter1366.encode('utf-8') if sys.version_info[0] == 2 else kiter1366) oprot.writeString(viter1367.encode('utf-8') if sys.version_info[0] == 2 else viter1367) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV4Wiper_args) generalEntityExtractV4Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.MAP, 'texts', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 ) class generalEntityExtractV4Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype1369, _vtype1370, _size1368) = iprot.readMapBegin() for _i1372 in range(_size1368): _key1373 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1374 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1374.read(iprot) self.success[_key1373] = _val1374 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractV4Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) for kiter1375, viter1376 in self.success.items(): oprot.writeString(kiter1375.encode('utf-8') if sys.version_info[0] == 2 else kiter1375) viter1376.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractV4Wiper_result) generalEntityExtractV4Wiper_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 0 ) class generalEntityClassifyV4_args(object): """ Attributes: - ctx - note_id - cate - entities - entityFeature """ def __init__(self, ctx=None, note_id=None, cate=None, entities=None, entityFeature=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.entities = entities self.entityFeature = entityFeature def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.entities = {} (_ktype1378, _vtype1379, _size1377) = iprot.readMapBegin() for _i1381 in range(_size1377): _key1382 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1383 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1383.read(iprot) self.entities[_key1382] = _val1383 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.entityFeature = {} (_ktype1385, _vtype1386, _size1384) = iprot.readMapBegin() for _i1388 in range(_size1384): _key1389 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1390 = {} (_ktype1392, _vtype1393, _size1391) = iprot.readMapBegin() for _i1395 in range(_size1391): _key1396 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1397 = iprot.readI32() _val1390[_key1396] = _val1397 iprot.readMapEnd() self.entityFeature[_key1389] = _val1390 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityClassifyV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.entities)) for kiter1398, viter1399 in self.entities.items(): oprot.writeString(kiter1398.encode('utf-8') if sys.version_info[0] == 2 else kiter1398) viter1399.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.entityFeature is not None: oprot.writeFieldBegin('entityFeature', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.entityFeature)) for kiter1400, viter1401 in self.entityFeature.items(): oprot.writeString(kiter1400.encode('utf-8') if sys.version_info[0] == 2 else kiter1400) oprot.writeMapBegin(TType.STRING, TType.I32, len(viter1401)) for kiter1402, viter1403 in viter1401.items(): oprot.writeString(kiter1402.encode('utf-8') if sys.version_info[0] == 2 else kiter1402) oprot.writeI32(viter1403) oprot.writeMapEnd() oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.entities is None: raise TProtocolException(message='Required field entities is unset!') if self.entityFeature is None: raise TProtocolException(message='Required field entityFeature is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityClassifyV4_args) generalEntityClassifyV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.MAP, 'entities', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 4 (5, TType.MAP, 'entityFeature', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.I32, None, False), False), None, ), # 5 ) class generalEntityClassifyV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype1405, _vtype1406, _size1404) = iprot.readMapBegin() for _i1408 in range(_size1404): _key1409 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1410 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1410.read(iprot) self.success[_key1409] = _val1410 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityClassifyV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) for kiter1411, viter1412 in self.success.items(): oprot.writeString(kiter1411.encode('utf-8') if sys.version_info[0] == 2 else kiter1411) viter1412.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityClassifyV4_result) generalEntityClassifyV4_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 0 ) class generalEntityClassifyV4Wiper_args(object): """ Attributes: - ctx - note_id - cate - entities - entityFeature """ def __init__(self, ctx=None, note_id=None, cate=None, entities=None, entityFeature=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.entities = entities self.entityFeature = entityFeature def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.entities = {} (_ktype1414, _vtype1415, _size1413) = iprot.readMapBegin() for _i1417 in range(_size1413): _key1418 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1419 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1419.read(iprot) self.entities[_key1418] = _val1419 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.entityFeature = {} (_ktype1421, _vtype1422, _size1420) = iprot.readMapBegin() for _i1424 in range(_size1420): _key1425 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1426 = {} (_ktype1428, _vtype1429, _size1427) = iprot.readMapBegin() for _i1431 in range(_size1427): _key1432 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1433 = iprot.readI32() _val1426[_key1432] = _val1433 iprot.readMapEnd() self.entityFeature[_key1425] = _val1426 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityClassifyV4Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.entities)) for kiter1434, viter1435 in self.entities.items(): oprot.writeString(kiter1434.encode('utf-8') if sys.version_info[0] == 2 else kiter1434) viter1435.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.entityFeature is not None: oprot.writeFieldBegin('entityFeature', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.entityFeature)) for kiter1436, viter1437 in self.entityFeature.items(): oprot.writeString(kiter1436.encode('utf-8') if sys.version_info[0] == 2 else kiter1436) oprot.writeMapBegin(TType.STRING, TType.I32, len(viter1437)) for kiter1438, viter1439 in viter1437.items(): oprot.writeString(kiter1438.encode('utf-8') if sys.version_info[0] == 2 else kiter1438) oprot.writeI32(viter1439) oprot.writeMapEnd() oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.entities is None: raise TProtocolException(message='Required field entities is unset!') if self.entityFeature is None: raise TProtocolException(message='Required field entityFeature is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityClassifyV4Wiper_args) generalEntityClassifyV4Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.MAP, 'entities', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 4 (5, TType.MAP, 'entityFeature', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.I32, None, False), False), None, ), # 5 ) class generalEntityClassifyV4Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype1441, _vtype1442, _size1440) = iprot.readMapBegin() for _i1444 in range(_size1440): _key1445 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val1446 = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() _val1446.read(iprot) self.success[_key1445] = _val1446 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityClassifyV4Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) for kiter1447, viter1448 in self.success.items(): oprot.writeString(kiter1447.encode('utf-8') if sys.version_info[0] == 2 else kiter1447) viter1448.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityClassifyV4Wiper_result) generalEntityClassifyV4Wiper_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], False), None, ), # 0 ) class generalEntityRelationV4_args(object): """ Attributes: - ctx - note_id - cate - text - entities """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, entities=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.entities = entities def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.entities = [] (_etype1452, _size1449) = iprot.readListBegin() for _i1453 in range(_size1449): _elem1454 = titancaesar.thrift.caesar.dto.ttypes.NEREntity() _elem1454.read(iprot) self.entities.append(_elem1454) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityRelationV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.entities)) for iter1455 in self.entities: iter1455.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.entities is None: raise TProtocolException(message='Required field entities is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityRelationV4_args) generalEntityRelationV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.LIST, 'entities', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.NEREntity, None], False), None, ), # 5 ) class generalEntityRelationV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityRelationV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityRelationV4_result) generalEntityRelationV4_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class generalEntityRelationV4Wiper_args(object): """ Attributes: - ctx - note_id - cate - text - entities """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, entities=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.entities = entities def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.entities = [] (_etype1459, _size1456) = iprot.readListBegin() for _i1460 in range(_size1456): _elem1461 = titancaesar.thrift.caesar.dto.ttypes.NEREntity() _elem1461.read(iprot) self.entities.append(_elem1461) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityRelationV4Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.entities is not None: oprot.writeFieldBegin('entities', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.entities)) for iter1462 in self.entities: iter1462.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.entities is None: raise TProtocolException(message='Required field entities is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityRelationV4Wiper_args) generalEntityRelationV4Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.LIST, 'entities', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.NEREntity, None], False), None, ), # 5 ) class generalEntityRelationV4Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityRelationV4Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityRelationV4Wiper_result) generalEntityRelationV4Wiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class generalEntityExtractWiper_args(object): """ Attributes: - ctx - note_id - cate - text """ def __init__(self, ctx=None, note_id=None, cate=None, text=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractWiper_args) generalEntityExtractWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 ) class generalEntityExtractWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('generalEntityExtractWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(generalEntityExtractWiper_result) generalEntityExtractWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.GeneralNerResult, None], None, ), # 0 ) class importanceScore_args(object): """ Attributes: - ctx - note_id - cate - text - entity_rst - usr_tag """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, entity_rst=None, usr_tag=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.entity_rst = entity_rst self.usr_tag = usr_tag def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.entity_rst = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScore_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.entity_rst is not None: oprot.writeFieldBegin('entity_rst', TType.STRING, 5) oprot.writeString(self.entity_rst.encode('utf-8') if sys.version_info[0] == 2 else self.entity_rst) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 6) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.entity_rst is None: raise TProtocolException(message='Required field entity_rst is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScore_args) importanceScore_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'entity_rst', 'UTF8', None, ), # 5 (6, TType.STRING, 'usr_tag', 'UTF8', None, ), # 6 ) class importanceScore_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScore_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScore_result) importanceScore_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceWiper_args(object): """ Attributes: - ctx - note_id - cate - text - entity_rst - usr_tag """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, entity_rst=None, usr_tag=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.entity_rst = entity_rst self.usr_tag = usr_tag def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.entity_rst = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.entity_rst is not None: oprot.writeFieldBegin('entity_rst', TType.STRING, 5) oprot.writeString(self.entity_rst.encode('utf-8') if sys.version_info[0] == 2 else self.entity_rst) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 6) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.entity_rst is None: raise TProtocolException(message='Required field entity_rst is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiper_args) importanceWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'entity_rst', 'UTF8', None, ), # 5 (6, TType.STRING, 'usr_tag', 'UTF8', None, ), # 6 ) class importanceWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiper_result) importanceWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceScoreV3_args(object): """ Attributes: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, note_entities=None, standard_entities=None, usr_tag=None, note_title=None, note_topic=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.note_entities = note_entities self.standard_entities = standard_entities self.usr_tag = usr_tag self.note_title = note_title self.note_topic = note_topic def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.standard_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.note_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 5) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.standard_entities is not None: oprot.writeFieldBegin('standard_entities', TType.STRING, 6) oprot.writeString(self.standard_entities.encode('utf-8') if sys.version_info[0] == 2 else self.standard_entities) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 8) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.note_topic is not None: oprot.writeFieldBegin('note_topic', TType.STRING, 9) oprot.writeString(self.note_topic.encode('utf-8') if sys.version_info[0] == 2 else self.note_topic) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.standard_entities is None: raise TProtocolException(message='Required field standard_entities is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.note_topic is None: raise TProtocolException(message='Required field note_topic is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV3_args) importanceScoreV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'note_entities', 'UTF8', None, ), # 5 (6, TType.STRING, 'standard_entities', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_title', 'UTF8', None, ), # 8 (9, TType.STRING, 'note_topic', 'UTF8', None, ), # 9 ) class importanceScoreV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV3_result) importanceScoreV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceWiperV3_args(object): """ Attributes: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, note_entities=None, standard_entities=None, usr_tag=None, note_title=None, note_topic=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.note_entities = note_entities self.standard_entities = standard_entities self.usr_tag = usr_tag self.note_title = note_title self.note_topic = note_topic def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.standard_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.note_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 5) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.standard_entities is not None: oprot.writeFieldBegin('standard_entities', TType.STRING, 6) oprot.writeString(self.standard_entities.encode('utf-8') if sys.version_info[0] == 2 else self.standard_entities) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 8) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.note_topic is not None: oprot.writeFieldBegin('note_topic', TType.STRING, 9) oprot.writeString(self.note_topic.encode('utf-8') if sys.version_info[0] == 2 else self.note_topic) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.standard_entities is None: raise TProtocolException(message='Required field standard_entities is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.note_topic is None: raise TProtocolException(message='Required field note_topic is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV3_args) importanceWiperV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'note_entities', 'UTF8', None, ), # 5 (6, TType.STRING, 'standard_entities', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_title', 'UTF8', None, ), # 8 (9, TType.STRING, 'note_topic', 'UTF8', None, ), # 9 ) class importanceWiperV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV3_result) importanceWiperV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceScoreV4_args(object): """ Attributes: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, note_entities=None, standard_entities=None, usr_tag=None, note_title=None, note_topic=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.note_entities = note_entities self.standard_entities = standard_entities self.usr_tag = usr_tag self.note_title = note_title self.note_topic = note_topic def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.standard_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.note_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 5) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.standard_entities is not None: oprot.writeFieldBegin('standard_entities', TType.STRING, 6) oprot.writeString(self.standard_entities.encode('utf-8') if sys.version_info[0] == 2 else self.standard_entities) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 8) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.note_topic is not None: oprot.writeFieldBegin('note_topic', TType.STRING, 9) oprot.writeString(self.note_topic.encode('utf-8') if sys.version_info[0] == 2 else self.note_topic) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.standard_entities is None: raise TProtocolException(message='Required field standard_entities is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.note_topic is None: raise TProtocolException(message='Required field note_topic is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV4_args) importanceScoreV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'note_entities', 'UTF8', None, ), # 5 (6, TType.STRING, 'standard_entities', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_title', 'UTF8', None, ), # 8 (9, TType.STRING, 'note_topic', 'UTF8', None, ), # 9 ) class importanceScoreV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV4_result) importanceScoreV4_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceScoreV5_args(object): """ Attributes: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ def __init__(self, ctx=None, note_id=None, predict_note_entities=None, note_entities=None, taxonomy=None, note_title=None, usr_tag=None, note_content=None, ocr=None, note_type=None, images=None, videoframes=None, task=None,): self.ctx = ctx self.note_id = note_id self.predict_note_entities = predict_note_entities self.note_entities = note_entities self.taxonomy = taxonomy self.note_title = note_title self.usr_tag = usr_tag self.note_content = note_content self.ocr = ocr self.note_type = note_type self.images = images self.videoframes = videoframes self.task = task def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.predict_note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.ocr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: self.note_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.images = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.videoframes = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.task = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV5_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.predict_note_entities is not None: oprot.writeFieldBegin('predict_note_entities', TType.STRING, 3) oprot.writeString(self.predict_note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.predict_note_entities) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 4) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.taxonomy is not None: oprot.writeFieldBegin('taxonomy', TType.STRING, 5) oprot.writeString(self.taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 6) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_content is not None: oprot.writeFieldBegin('note_content', TType.STRING, 8) oprot.writeString(self.note_content.encode('utf-8') if sys.version_info[0] == 2 else self.note_content) oprot.writeFieldEnd() if self.ocr is not None: oprot.writeFieldBegin('ocr', TType.STRING, 9) oprot.writeString(self.ocr.encode('utf-8') if sys.version_info[0] == 2 else self.ocr) oprot.writeFieldEnd() if self.note_type is not None: oprot.writeFieldBegin('note_type', TType.I32, 10) oprot.writeI32(self.note_type) oprot.writeFieldEnd() if self.images is not None: oprot.writeFieldBegin('images', TType.STRING, 11) oprot.writeString(self.images.encode('utf-8') if sys.version_info[0] == 2 else self.images) oprot.writeFieldEnd() if self.videoframes is not None: oprot.writeFieldBegin('videoframes', TType.STRING, 12) oprot.writeString(self.videoframes.encode('utf-8') if sys.version_info[0] == 2 else self.videoframes) oprot.writeFieldEnd() if self.task is not None: oprot.writeFieldBegin('task', TType.STRING, 13) oprot.writeString(self.task.encode('utf-8') if sys.version_info[0] == 2 else self.task) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.predict_note_entities is None: raise TProtocolException(message='Required field predict_note_entities is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.taxonomy is None: raise TProtocolException(message='Required field taxonomy is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_content is None: raise TProtocolException(message='Required field note_content is unset!') if self.ocr is None: raise TProtocolException(message='Required field ocr is unset!') if self.note_type is None: raise TProtocolException(message='Required field note_type is unset!') if self.images is None: raise TProtocolException(message='Required field images is unset!') if self.videoframes is None: raise TProtocolException(message='Required field videoframes is unset!') if self.task is None: raise TProtocolException(message='Required field task is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV5_args) importanceScoreV5_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'predict_note_entities', 'UTF8', None, ), # 3 (4, TType.STRING, 'note_entities', 'UTF8', None, ), # 4 (5, TType.STRING, 'taxonomy', 'UTF8', None, ), # 5 (6, TType.STRING, 'note_title', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_content', 'UTF8', None, ), # 8 (9, TType.STRING, 'ocr', 'UTF8', None, ), # 9 (10, TType.I32, 'note_type', None, None, ), # 10 (11, TType.STRING, 'images', 'UTF8', None, ), # 11 (12, TType.STRING, 'videoframes', 'UTF8', None, ), # 12 (13, TType.STRING, 'task', 'UTF8', None, ), # 13 ) class importanceScoreV5_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV5_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV5_result) importanceScoreV5_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceWiperV5_args(object): """ Attributes: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ def __init__(self, ctx=None, note_id=None, predict_note_entities=None, note_entities=None, taxonomy=None, note_title=None, usr_tag=None, note_content=None, ocr=None, note_type=None, images=None, videoframes=None, task=None,): self.ctx = ctx self.note_id = note_id self.predict_note_entities = predict_note_entities self.note_entities = note_entities self.taxonomy = taxonomy self.note_title = note_title self.usr_tag = usr_tag self.note_content = note_content self.ocr = ocr self.note_type = note_type self.images = images self.videoframes = videoframes self.task = task def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.predict_note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.ocr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: self.note_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.images = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.videoframes = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.task = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV5_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.predict_note_entities is not None: oprot.writeFieldBegin('predict_note_entities', TType.STRING, 3) oprot.writeString(self.predict_note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.predict_note_entities) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 4) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.taxonomy is not None: oprot.writeFieldBegin('taxonomy', TType.STRING, 5) oprot.writeString(self.taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 6) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_content is not None: oprot.writeFieldBegin('note_content', TType.STRING, 8) oprot.writeString(self.note_content.encode('utf-8') if sys.version_info[0] == 2 else self.note_content) oprot.writeFieldEnd() if self.ocr is not None: oprot.writeFieldBegin('ocr', TType.STRING, 9) oprot.writeString(self.ocr.encode('utf-8') if sys.version_info[0] == 2 else self.ocr) oprot.writeFieldEnd() if self.note_type is not None: oprot.writeFieldBegin('note_type', TType.I32, 10) oprot.writeI32(self.note_type) oprot.writeFieldEnd() if self.images is not None: oprot.writeFieldBegin('images', TType.STRING, 11) oprot.writeString(self.images.encode('utf-8') if sys.version_info[0] == 2 else self.images) oprot.writeFieldEnd() if self.videoframes is not None: oprot.writeFieldBegin('videoframes', TType.STRING, 12) oprot.writeString(self.videoframes.encode('utf-8') if sys.version_info[0] == 2 else self.videoframes) oprot.writeFieldEnd() if self.task is not None: oprot.writeFieldBegin('task', TType.STRING, 13) oprot.writeString(self.task.encode('utf-8') if sys.version_info[0] == 2 else self.task) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.predict_note_entities is None: raise TProtocolException(message='Required field predict_note_entities is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.taxonomy is None: raise TProtocolException(message='Required field taxonomy is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_content is None: raise TProtocolException(message='Required field note_content is unset!') if self.ocr is None: raise TProtocolException(message='Required field ocr is unset!') if self.note_type is None: raise TProtocolException(message='Required field note_type is unset!') if self.images is None: raise TProtocolException(message='Required field images is unset!') if self.videoframes is None: raise TProtocolException(message='Required field videoframes is unset!') if self.task is None: raise TProtocolException(message='Required field task is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV5_args) importanceWiperV5_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'predict_note_entities', 'UTF8', None, ), # 3 (4, TType.STRING, 'note_entities', 'UTF8', None, ), # 4 (5, TType.STRING, 'taxonomy', 'UTF8', None, ), # 5 (6, TType.STRING, 'note_title', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_content', 'UTF8', None, ), # 8 (9, TType.STRING, 'ocr', 'UTF8', None, ), # 9 (10, TType.I32, 'note_type', None, None, ), # 10 (11, TType.STRING, 'images', 'UTF8', None, ), # 11 (12, TType.STRING, 'videoframes', 'UTF8', None, ), # 12 (13, TType.STRING, 'task', 'UTF8', None, ), # 13 ) class importanceWiperV5_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV5_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV5_result) importanceWiperV5_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceScoreV5Test_args(object): """ Attributes: - ctx - note_id - predict_note_entities - note_entities - taxonomy - note_title - usr_tag - note_content - ocr - note_type - images - videoframes - task """ def __init__(self, ctx=None, note_id=None, predict_note_entities=None, note_entities=None, taxonomy=None, note_title=None, usr_tag=None, note_content=None, ocr=None, note_type=None, images=None, videoframes=None, task=None,): self.ctx = ctx self.note_id = note_id self.predict_note_entities = predict_note_entities self.note_entities = note_entities self.taxonomy = taxonomy self.note_title = note_title self.usr_tag = usr_tag self.note_content = note_content self.ocr = ocr self.note_type = note_type self.images = images self.videoframes = videoframes self.task = task def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.predict_note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.taxonomy = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.ocr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: self.note_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.images = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.videoframes = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: self.task = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV5Test_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.predict_note_entities is not None: oprot.writeFieldBegin('predict_note_entities', TType.STRING, 3) oprot.writeString(self.predict_note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.predict_note_entities) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 4) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.taxonomy is not None: oprot.writeFieldBegin('taxonomy', TType.STRING, 5) oprot.writeString(self.taxonomy.encode('utf-8') if sys.version_info[0] == 2 else self.taxonomy) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 6) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_content is not None: oprot.writeFieldBegin('note_content', TType.STRING, 8) oprot.writeString(self.note_content.encode('utf-8') if sys.version_info[0] == 2 else self.note_content) oprot.writeFieldEnd() if self.ocr is not None: oprot.writeFieldBegin('ocr', TType.STRING, 9) oprot.writeString(self.ocr.encode('utf-8') if sys.version_info[0] == 2 else self.ocr) oprot.writeFieldEnd() if self.note_type is not None: oprot.writeFieldBegin('note_type', TType.I32, 10) oprot.writeI32(self.note_type) oprot.writeFieldEnd() if self.images is not None: oprot.writeFieldBegin('images', TType.STRING, 11) oprot.writeString(self.images.encode('utf-8') if sys.version_info[0] == 2 else self.images) oprot.writeFieldEnd() if self.videoframes is not None: oprot.writeFieldBegin('videoframes', TType.STRING, 12) oprot.writeString(self.videoframes.encode('utf-8') if sys.version_info[0] == 2 else self.videoframes) oprot.writeFieldEnd() if self.task is not None: oprot.writeFieldBegin('task', TType.STRING, 13) oprot.writeString(self.task.encode('utf-8') if sys.version_info[0] == 2 else self.task) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.predict_note_entities is None: raise TProtocolException(message='Required field predict_note_entities is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.taxonomy is None: raise TProtocolException(message='Required field taxonomy is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_content is None: raise TProtocolException(message='Required field note_content is unset!') if self.ocr is None: raise TProtocolException(message='Required field ocr is unset!') if self.note_type is None: raise TProtocolException(message='Required field note_type is unset!') if self.images is None: raise TProtocolException(message='Required field images is unset!') if self.videoframes is None: raise TProtocolException(message='Required field videoframes is unset!') if self.task is None: raise TProtocolException(message='Required field task is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV5Test_args) importanceScoreV5Test_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'predict_note_entities', 'UTF8', None, ), # 3 (4, TType.STRING, 'note_entities', 'UTF8', None, ), # 4 (5, TType.STRING, 'taxonomy', 'UTF8', None, ), # 5 (6, TType.STRING, 'note_title', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_content', 'UTF8', None, ), # 8 (9, TType.STRING, 'ocr', 'UTF8', None, ), # 9 (10, TType.I32, 'note_type', None, None, ), # 10 (11, TType.STRING, 'images', 'UTF8', None, ), # 11 (12, TType.STRING, 'videoframes', 'UTF8', None, ), # 12 (13, TType.STRING, 'task', 'UTF8', None, ), # 13 ) class importanceScoreV5Test_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV5Test_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV5Test_result) importanceScoreV5Test_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceWiperV4_args(object): """ Attributes: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, note_entities=None, standard_entities=None, usr_tag=None, note_title=None, note_topic=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.note_entities = note_entities self.standard_entities = standard_entities self.usr_tag = usr_tag self.note_title = note_title self.note_topic = note_topic def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.standard_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.note_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 5) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.standard_entities is not None: oprot.writeFieldBegin('standard_entities', TType.STRING, 6) oprot.writeString(self.standard_entities.encode('utf-8') if sys.version_info[0] == 2 else self.standard_entities) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 8) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.note_topic is not None: oprot.writeFieldBegin('note_topic', TType.STRING, 9) oprot.writeString(self.note_topic.encode('utf-8') if sys.version_info[0] == 2 else self.note_topic) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.standard_entities is None: raise TProtocolException(message='Required field standard_entities is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.note_topic is None: raise TProtocolException(message='Required field note_topic is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV4_args) importanceWiperV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'note_entities', 'UTF8', None, ), # 5 (6, TType.STRING, 'standard_entities', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_title', 'UTF8', None, ), # 8 (9, TType.STRING, 'note_topic', 'UTF8', None, ), # 9 ) class importanceWiperV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceWiperV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceWiperV4_result) importanceWiperV4_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class importanceScoreV4Test_args(object): """ Attributes: - ctx - note_id - cate - text - note_entities - standard_entities - usr_tag - note_title - note_topic """ def __init__(self, ctx=None, note_id=None, cate=None, text=None, note_entities=None, standard_entities=None, usr_tag=None, note_title=None, note_topic=None,): self.ctx = ctx self.note_id = note_id self.cate = cate self.text = text self.note_entities = note_entities self.standard_entities = standard_entities self.usr_tag = usr_tag self.note_title = note_title self.note_topic = note_topic def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.cate = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.note_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.standard_entities = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.usr_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.note_title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.note_topic = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV4Test_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.cate is not None: oprot.writeFieldBegin('cate', TType.STRING, 3) oprot.writeString(self.cate.encode('utf-8') if sys.version_info[0] == 2 else self.cate) oprot.writeFieldEnd() if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 4) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.note_entities is not None: oprot.writeFieldBegin('note_entities', TType.STRING, 5) oprot.writeString(self.note_entities.encode('utf-8') if sys.version_info[0] == 2 else self.note_entities) oprot.writeFieldEnd() if self.standard_entities is not None: oprot.writeFieldBegin('standard_entities', TType.STRING, 6) oprot.writeString(self.standard_entities.encode('utf-8') if sys.version_info[0] == 2 else self.standard_entities) oprot.writeFieldEnd() if self.usr_tag is not None: oprot.writeFieldBegin('usr_tag', TType.STRING, 7) oprot.writeString(self.usr_tag.encode('utf-8') if sys.version_info[0] == 2 else self.usr_tag) oprot.writeFieldEnd() if self.note_title is not None: oprot.writeFieldBegin('note_title', TType.STRING, 8) oprot.writeString(self.note_title.encode('utf-8') if sys.version_info[0] == 2 else self.note_title) oprot.writeFieldEnd() if self.note_topic is not None: oprot.writeFieldBegin('note_topic', TType.STRING, 9) oprot.writeString(self.note_topic.encode('utf-8') if sys.version_info[0] == 2 else self.note_topic) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.cate is None: raise TProtocolException(message='Required field cate is unset!') if self.text is None: raise TProtocolException(message='Required field text is unset!') if self.note_entities is None: raise TProtocolException(message='Required field note_entities is unset!') if self.standard_entities is None: raise TProtocolException(message='Required field standard_entities is unset!') if self.usr_tag is None: raise TProtocolException(message='Required field usr_tag is unset!') if self.note_title is None: raise TProtocolException(message='Required field note_title is unset!') if self.note_topic is None: raise TProtocolException(message='Required field note_topic is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV4Test_args) importanceScoreV4Test_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'cate', 'UTF8', None, ), # 3 (4, TType.STRING, 'text', 'UTF8', None, ), # 4 (5, TType.STRING, 'note_entities', 'UTF8', None, ), # 5 (6, TType.STRING, 'standard_entities', 'UTF8', None, ), # 6 (7, TType.STRING, 'usr_tag', 'UTF8', None, ), # 7 (8, TType.STRING, 'note_title', 'UTF8', None, ), # 8 (9, TType.STRING, 'note_topic', 'UTF8', None, ), # 9 ) class importanceScoreV4Test_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('importanceScoreV4Test_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(importanceScoreV4Test_result) importanceScoreV4Test_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.ImportanceScoreResult, None], None, ), # 0 ) class queryNER_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1466, _size1463) = iprot.readListBegin() for _i1467 in range(_size1463): _elem1468 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1468) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNER_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1469 in self.texts: oprot.writeString(iter1469.encode('utf-8') if sys.version_info[0] == 2 else iter1469) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNER_args) queryNER_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class queryNER_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNER_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNER_result) queryNER_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryNerResult, None], None, ), # 0 ) class queryNERV2_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1473, _size1470) = iprot.readListBegin() for _i1474 in range(_size1470): _elem1475 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1475) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1476 in self.texts: oprot.writeString(iter1476.encode('utf-8') if sys.version_info[0] == 2 else iter1476) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV2_args) queryNERV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class queryNERV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV2_result) queryNERV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryNerResult, None], None, ), # 0 ) class queryNERV3_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1480, _size1477) = iprot.readListBegin() for _i1481 in range(_size1477): _elem1482 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1482) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV3_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1483 in self.texts: oprot.writeString(iter1483.encode('utf-8') if sys.version_info[0] == 2 else iter1483) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV3_args) queryNERV3_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class queryNERV3_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV3_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV3_result) queryNERV3_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryNerResult, None], None, ), # 0 ) class queryNERV4_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1487, _size1484) = iprot.readListBegin() for _i1488 in range(_size1484): _elem1489 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1489) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV4_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1490 in self.texts: oprot.writeString(iter1490.encode('utf-8') if sys.version_info[0] == 2 else iter1490) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV4_args) queryNERV4_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class queryNERV4_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NewQueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryNERV4_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryNERV4_result) queryNERV4_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NewQueryNerResult, None], None, ), # 0 ) class sentNER_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1494, _size1491) = iprot.readListBegin() for _i1495 in range(_size1491): _elem1496 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1496) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentNER_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1497 in self.texts: oprot.writeString(iter1497.encode('utf-8') if sys.version_info[0] == 2 else iter1497) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentNER_args) sentNER_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class sentNER_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentNER_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentNER_result) sentNER_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryNerResult, None], None, ), # 0 ) class sentNERLatest_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1501, _size1498) = iprot.readListBegin() for _i1502 in range(_size1498): _elem1503 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1503) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentNERLatest_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1504 in self.texts: oprot.writeString(iter1504.encode('utf-8') if sys.version_info[0] == 2 else iter1504) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentNERLatest_args) sentNERLatest_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class sentNERLatest_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryNerResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sentNERLatest_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(sentNERLatest_result) sentNERLatest_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryNerResult, None], None, ), # 0 ) class noteFeedback_args(object): """ Attributes: - ctx - note_id - title - content """ def __init__(self, ctx=None, note_id=None, title=None, content=None,): self.ctx = ctx self.note_id = note_id self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteFeedback_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 3) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 4) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteFeedback_args) noteFeedback_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'title', 'UTF8', None, ), # 3 (4, TType.STRING, 'content', 'UTF8', None, ), # 4 ) class noteFeedback_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteFeedbackResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteFeedback_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteFeedback_result) noteFeedback_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteFeedbackResult, None], None, ), # 0 ) class noteFeedbackV2_args(object): """ Attributes: - ctx - note_id - title - content """ def __init__(self, ctx=None, note_id=None, title=None, content=None,): self.ctx = ctx self.note_id = note_id self.title = title self.content = content def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.note_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.content = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteFeedbackV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.note_id is not None: oprot.writeFieldBegin('note_id', TType.STRING, 2) oprot.writeString(self.note_id.encode('utf-8') if sys.version_info[0] == 2 else self.note_id) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 3) oprot.writeString(self.title.encode('utf-8') if sys.version_info[0] == 2 else self.title) oprot.writeFieldEnd() if self.content is not None: oprot.writeFieldBegin('content', TType.STRING, 4) oprot.writeString(self.content.encode('utf-8') if sys.version_info[0] == 2 else self.content) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.note_id is None: raise TProtocolException(message='Required field note_id is unset!') if self.title is None: raise TProtocolException(message='Required field title is unset!') if self.content is None: raise TProtocolException(message='Required field content is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteFeedbackV2_args) noteFeedbackV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'note_id', 'UTF8', None, ), # 2 (3, TType.STRING, 'title', 'UTF8', None, ), # 3 (4, TType.STRING, 'content', 'UTF8', None, ), # 4 ) class noteFeedbackV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteFeedbackResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteFeedbackV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteFeedbackV2_result) noteFeedbackV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteFeedbackResult, None], None, ), # 0 ) class amazingCover_args(object): """ Attributes: - ctx - key_frames """ def __init__(self, ctx=None, key_frames=None,): self.ctx = ctx self.key_frames = key_frames def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.key_frames = [] (_etype1508, _size1505) = iprot.readListBegin() for _i1509 in range(_size1505): _elem1510 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.key_frames.append(_elem1510) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('amazingCover_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.key_frames is not None: oprot.writeFieldBegin('key_frames', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.key_frames)) for iter1511 in self.key_frames: oprot.writeString(iter1511.encode('utf-8') if sys.version_info[0] == 2 else iter1511) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.key_frames is None: raise TProtocolException(message='Required field key_frames is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(amazingCover_args) amazingCover_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'key_frames', (TType.STRING, 'UTF8', False), None, ), # 2 ) class amazingCover_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.AmazingCoverResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('amazingCover_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(amazingCover_result) amazingCover_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.AmazingCoverResult, None], None, ), # 0 ) class noteEmbedding_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype1515, _size1512) = iprot.readListBegin() for _i1516 in range(_size1512): _elem1517 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem1517) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype1521, _size1518) = iprot.readListBegin() for _i1522 in range(_size1518): _elem1523 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem1523) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype1527, _size1524) = iprot.readListBegin() for _i1528 in range(_size1524): _elem1529 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem1529) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype1533, _size1530) = iprot.readListBegin() for _i1534 in range(_size1530): _elem1535 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem1535) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype1539, _size1536) = iprot.readListBegin() for _i1540 in range(_size1536): _elem1541 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem1541) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter1542 in self.topicList: oprot.writeString(iter1542.encode('utf-8') if sys.version_info[0] == 2 else iter1542) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter1543 in self.titleList: oprot.writeString(iter1543.encode('utf-8') if sys.version_info[0] == 2 else iter1543) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter1544 in self.contentList: oprot.writeString(iter1544.encode('utf-8') if sys.version_info[0] == 2 else iter1544) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter1545 in self.imageList: oprot.writeString(iter1545.encode('utf-8') if sys.version_info[0] == 2 else iter1545) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter1546 in self.keyFrameList: oprot.writeString(iter1546.encode('utf-8') if sys.version_info[0] == 2 else iter1546) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEmbedding_args) noteEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class noteEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEmbedding_result) noteEmbedding_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteEmbeddingResult, None], None, ), # 0 ) class noteEmbeddingWiper_args(object): """ Attributes: - ctx - noteId - noteType - useCache - topicList - titleList - contentList - imageList - keyFrameList """ def __init__(self, ctx=None, noteId=None, noteType=None, useCache=None, topicList=None, titleList=None, contentList=None, imageList=None, keyFrameList=None,): self.ctx = ctx self.noteId = noteId self.noteType = noteType self.useCache = useCache self.topicList = topicList self.titleList = titleList self.contentList = contentList self.imageList = imageList self.keyFrameList = keyFrameList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.noteId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.noteType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.useCache = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.topicList = [] (_etype1550, _size1547) = iprot.readListBegin() for _i1551 in range(_size1547): _elem1552 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.topicList.append(_elem1552) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.titleList = [] (_etype1556, _size1553) = iprot.readListBegin() for _i1557 in range(_size1553): _elem1558 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.titleList.append(_elem1558) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.contentList = [] (_etype1562, _size1559) = iprot.readListBegin() for _i1563 in range(_size1559): _elem1564 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.contentList.append(_elem1564) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.imageList = [] (_etype1568, _size1565) = iprot.readListBegin() for _i1569 in range(_size1565): _elem1570 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.imageList.append(_elem1570) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.keyFrameList = [] (_etype1574, _size1571) = iprot.readListBegin() for _i1575 in range(_size1571): _elem1576 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.keyFrameList.append(_elem1576) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEmbeddingWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.noteId is not None: oprot.writeFieldBegin('noteId', TType.STRING, 2) oprot.writeString(self.noteId.encode('utf-8') if sys.version_info[0] == 2 else self.noteId) oprot.writeFieldEnd() if self.noteType is not None: oprot.writeFieldBegin('noteType', TType.I32, 3) oprot.writeI32(self.noteType) oprot.writeFieldEnd() if self.useCache is not None: oprot.writeFieldBegin('useCache', TType.BOOL, 4) oprot.writeBool(self.useCache) oprot.writeFieldEnd() if self.topicList is not None: oprot.writeFieldBegin('topicList', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.topicList)) for iter1577 in self.topicList: oprot.writeString(iter1577.encode('utf-8') if sys.version_info[0] == 2 else iter1577) oprot.writeListEnd() oprot.writeFieldEnd() if self.titleList is not None: oprot.writeFieldBegin('titleList', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.titleList)) for iter1578 in self.titleList: oprot.writeString(iter1578.encode('utf-8') if sys.version_info[0] == 2 else iter1578) oprot.writeListEnd() oprot.writeFieldEnd() if self.contentList is not None: oprot.writeFieldBegin('contentList', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.contentList)) for iter1579 in self.contentList: oprot.writeString(iter1579.encode('utf-8') if sys.version_info[0] == 2 else iter1579) oprot.writeListEnd() oprot.writeFieldEnd() if self.imageList is not None: oprot.writeFieldBegin('imageList', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.imageList)) for iter1580 in self.imageList: oprot.writeString(iter1580.encode('utf-8') if sys.version_info[0] == 2 else iter1580) oprot.writeListEnd() oprot.writeFieldEnd() if self.keyFrameList is not None: oprot.writeFieldBegin('keyFrameList', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.keyFrameList)) for iter1581 in self.keyFrameList: oprot.writeString(iter1581.encode('utf-8') if sys.version_info[0] == 2 else iter1581) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEmbeddingWiper_args) noteEmbeddingWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'noteId', 'UTF8', None, ), # 2 (3, TType.I32, 'noteType', None, None, ), # 3 (4, TType.BOOL, 'useCache', None, None, ), # 4 (5, TType.LIST, 'topicList', (TType.STRING, 'UTF8', False), None, ), # 5 (6, TType.LIST, 'titleList', (TType.STRING, 'UTF8', False), None, ), # 6 (7, TType.LIST, 'contentList', (TType.STRING, 'UTF8', False), None, ), # 7 (8, TType.LIST, 'imageList', (TType.STRING, 'UTF8', False), None, ), # 8 (9, TType.LIST, 'keyFrameList', (TType.STRING, 'UTF8', False), None, ), # 9 ) class noteEmbeddingWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteEmbeddingWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteEmbeddingWiper_result) noteEmbeddingWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteEmbeddingResult, None], None, ), # 0 ) class noteInformationClassify_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassify_args) noteInformationClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest, None], None, ), # 2 ) class noteInformationClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassify_result) noteInformationClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult, None], None, ), # 0 ) class noteInformationClassifyV2_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassifyV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassifyV2_args) noteInformationClassifyV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest, None], None, ), # 2 ) class noteInformationClassifyV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassifyV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassifyV2_result) noteInformationClassifyV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult, None], None, ), # 0 ) class noteInformationClassifyV2Wiper_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassifyV2Wiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassifyV2Wiper_args) noteInformationClassifyV2Wiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationRequest, None], None, ), # 2 ) class noteInformationClassifyV2Wiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteInformationClassifyV2Wiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteInformationClassifyV2Wiper_result) noteInformationClassifyV2Wiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteInformationResult, None], None, ), # 0 ) class noteTimelinessClassify_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteTimelinessClassify_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteTimelinessClassify_args) noteTimelinessClassify_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessRequest, None], None, ), # 2 ) class noteTimelinessClassify_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteTimelinessClassify_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteTimelinessClassify_result) noteTimelinessClassify_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessResult, None], None, ), # 0 ) class noteTimelinessClassifyWiper_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteTimelinessClassifyWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteTimelinessClassifyWiper_args) noteTimelinessClassifyWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessRequest, None], None, ), # 2 ) class noteTimelinessClassifyWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('noteTimelinessClassifyWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(noteTimelinessClassifyWiper_result) noteTimelinessClassifyWiper_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteTimelinessResult, None], None, ), # 0 ) class queryEmbedding_args(object): """ Attributes: - ctx - query """ def __init__(self, ctx=None, query=None,): self.ctx = ctx self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryEmbedding_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.query is None: raise TProtocolException(message='Required field query is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryEmbedding_args) queryEmbedding_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 ) class queryEmbedding_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryEmbedding_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryEmbedding_result) queryEmbedding_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult, None], None, ), # 0 ) class queryEmbeddingV2_args(object): """ Attributes: - ctx - query """ def __init__(self, ctx=None, query=None,): self.ctx = ctx self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryEmbeddingV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.query is None: raise TProtocolException(message='Required field query is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryEmbeddingV2_args) queryEmbeddingV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 ) class queryEmbeddingV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryEmbeddingV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryEmbeddingV2_result) queryEmbeddingV2_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult, None], None, ), # 0 ) class queryBatchEmbeddingV2_args(object): """ Attributes: - ctx - query """ def __init__(self, ctx=None, query=None,): self.ctx = ctx self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.query = [] (_etype1585, _size1582) = iprot.readListBegin() for _i1586 in range(_size1582): _elem1587 = titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingRequest() _elem1587.read(iprot) self.query.append(_elem1587) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryBatchEmbeddingV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.query)) for iter1588 in self.query: iter1588.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.query is None: raise TProtocolException(message='Required field query is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryBatchEmbeddingV2_args) queryBatchEmbeddingV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'query', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingRequest, None], False), None, ), # 2 ) class queryBatchEmbeddingV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1592, _size1589) = iprot.readListBegin() for _i1593 in range(_size1589): _elem1594 = titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult() _elem1594.read(iprot) self.success.append(_elem1594) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('queryBatchEmbeddingV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1595 in self.success: iter1595.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(queryBatchEmbeddingV2_result) queryBatchEmbeddingV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryEmbeddingResult, None], False), None, ), # 0 ) class getLabelCorrelation_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.QueryLabelCorrelationRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getLabelCorrelation_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getLabelCorrelation_args) getLabelCorrelation_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.QueryLabelCorrelationRequest, None], None, ), # 2 ) class getLabelCorrelation_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.QueryLabelCorrelationResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getLabelCorrelation_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getLabelCorrelation_result) getLabelCorrelation_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.QueryLabelCorrelationResult, None], None, ), # 0 ) class getDocGenerateQuery_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.DocGenerateQueryRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getDocGenerateQuery_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getDocGenerateQuery_args) getDocGenerateQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.DocGenerateQueryRequest, None], None, ), # 2 ) class getDocGenerateQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.DocGenerateQueryResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getDocGenerateQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getDocGenerateQuery_result) getDocGenerateQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.DocGenerateQueryResult, None], None, ), # 0 ) class baikeParse_args(object): """ Attributes: - ctx - url """ def __init__(self, ctx=None, url=None,): self.ctx = ctx self.url = url def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeParse_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.url is not None: oprot.writeFieldBegin('url', TType.STRING, 2) oprot.writeString(self.url.encode('utf-8') if sys.version_info[0] == 2 else self.url) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.url is None: raise TProtocolException(message='Required field url is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeParse_args) baikeParse_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'url', 'UTF8', None, ), # 2 ) class baikeParse_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeParse_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeParse_result) baikeParse_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class baikeParseWiper_args(object): """ Attributes: - ctx - url """ def __init__(self, ctx=None, url=None,): self.ctx = ctx self.url = url def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeParseWiper_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.url is not None: oprot.writeFieldBegin('url', TType.STRING, 2) oprot.writeString(self.url.encode('utf-8') if sys.version_info[0] == 2 else self.url) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.url is None: raise TProtocolException(message='Required field url is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeParseWiper_args) baikeParseWiper_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRING, 'url', 'UTF8', None, ), # 2 ) class baikeParseWiper_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('baikeParseWiper_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(baikeParseWiper_result) baikeParseWiper_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class getNoteIntent_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.request = titancaesar.thrift.caesar.dto.ttypes.NoteIntentRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getNoteIntent_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 2) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getNoteIntent_args) getNoteIntent_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'request', [titancaesar.thrift.caesar.dto.ttypes.NoteIntentRequest, None], None, ), # 2 ) class getNoteIntent_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.NoteIntentResult() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getNoteIntent_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getNoteIntent_result) getNoteIntent_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.NoteIntentResult, None], None, ), # 0 ) class getQueryGeneralIntent_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.request = [] (_etype1599, _size1596) = iprot.readListBegin() for _i1600 in range(_size1596): _elem1601 = titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentRequest() _elem1601.read(iprot) self.request.append(_elem1601) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryGeneralIntent_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.request)) for iter1602 in self.request: iter1602.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryGeneralIntent_args) getQueryGeneralIntent_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'request', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentRequest, None], False), None, ), # 2 ) class getQueryGeneralIntent_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1606, _size1603) = iprot.readListBegin() for _i1607 in range(_size1603): _elem1608 = titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentResult() _elem1608.read(iprot) self.success.append(_elem1608) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryGeneralIntent_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1609 in self.success: iter1609.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryGeneralIntent_result) getQueryGeneralIntent_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentResult, None], False), None, ), # 0 ) class getQueryGeneralIntentV2_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.request = [] (_etype1613, _size1610) = iprot.readListBegin() for _i1614 in range(_size1610): _elem1615 = titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentV2Request() _elem1615.read(iprot) self.request.append(_elem1615) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryGeneralIntentV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.request)) for iter1616 in self.request: iter1616.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryGeneralIntentV2_args) getQueryGeneralIntentV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'request', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentV2Request, None], False), None, ), # 2 ) class getQueryGeneralIntentV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1620, _size1617) = iprot.readListBegin() for _i1621 in range(_size1617): _elem1622 = titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentResult() _elem1622.read(iprot) self.success.append(_elem1622) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryGeneralIntentV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1623 in self.success: iter1623.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryGeneralIntentV2_result) getQueryGeneralIntentV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryGeneralIntentResult, None], False), None, ), # 0 ) class getQueryQualityV2_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.request = [] (_etype1627, _size1624) = iprot.readListBegin() for _i1628 in range(_size1624): _elem1629 = titancaesar.thrift.caesar.dto.ttypes.QueryQualityV2Request() _elem1629.read(iprot) self.request.append(_elem1629) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryQualityV2_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.request)) for iter1630 in self.request: iter1630.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryQualityV2_args) getQueryQualityV2_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'request', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryQualityV2Request, None], False), None, ), # 2 ) class getQueryQualityV2_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1634, _size1631) = iprot.readListBegin() for _i1635 in range(_size1631): _elem1636 = titancaesar.thrift.caesar.dto.ttypes.QueryQualityV2Result() _elem1636.read(iprot) self.success.append(_elem1636) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryQualityV2_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1637 in self.success: iter1637.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryQualityV2_result) getQueryQualityV2_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryQualityV2Result, None], False), None, ), # 0 ) class getQueryCorrection_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1641, _size1638) = iprot.readListBegin() for _i1642 in range(_size1638): _elem1643 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1643) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryCorrection_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1644 in self.texts: oprot.writeString(iter1644.encode('utf-8') if sys.version_info[0] == 2 else iter1644) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryCorrection_args) getQueryCorrection_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class getQueryCorrection_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1648, _size1645) = iprot.readListBegin() for _i1649 in range(_size1645): _elem1650 = titancaesar.thrift.caesar.dto.ttypes.QueryCorrectionResult() _elem1650.read(iprot) self.success.append(_elem1650) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQueryCorrection_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1651 in self.success: iter1651.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQueryCorrection_result) getQueryCorrection_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QueryCorrectionResult, None], False), None, ), # 0 ) class getQualityPPL_args(object): """ Attributes: - ctx - texts """ def __init__(self, ctx=None, texts=None,): self.ctx = ctx self.texts = texts def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.texts = [] (_etype1655, _size1652) = iprot.readListBegin() for _i1656 in range(_size1652): _elem1657 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.texts.append(_elem1657) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQualityPPL_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.texts is not None: oprot.writeFieldBegin('texts', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.texts)) for iter1658 in self.texts: oprot.writeString(iter1658.encode('utf-8') if sys.version_info[0] == 2 else iter1658) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.texts is None: raise TProtocolException(message='Required field texts is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQualityPPL_args) getQualityPPL_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'texts', (TType.STRING, 'UTF8', False), None, ), # 2 ) class getQualityPPL_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1662, _size1659) = iprot.readListBegin() for _i1663 in range(_size1659): _elem1664 = titancaesar.thrift.caesar.dto.ttypes.QualityKenLMResult() _elem1664.read(iprot) self.success.append(_elem1664) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQualityPPL_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1665 in self.success: iter1665.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQualityPPL_result) getQualityPPL_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QualityKenLMResult, None], False), None, ), # 0 ) class getQuerySynonym_args(object): """ Attributes: - ctx - request """ def __init__(self, ctx=None, request=None,): self.ctx = ctx self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.request = [] (_etype1669, _size1666) = iprot.readListBegin() for _i1670 in range(_size1666): _elem1671 = titancaesar.thrift.caesar.dto.ttypes.QuerySynonymRequest() _elem1671.read(iprot) self.request.append(_elem1671) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQuerySynonym_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.request is not None: oprot.writeFieldBegin('request', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.request)) for iter1672 in self.request: iter1672.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.request is None: raise TProtocolException(message='Required field request is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQuerySynonym_args) getQuerySynonym_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.LIST, 'request', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QuerySynonymRequest, None], False), None, ), # 2 ) class getQuerySynonym_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype1676, _size1673) = iprot.readListBegin() for _i1677 in range(_size1673): _elem1678 = titancaesar.thrift.caesar.dto.ttypes.QuerySynonymResult() _elem1678.read(iprot) self.success.append(_elem1678) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('getQuerySynonym_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter1679 in self.success: iter1679.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(getQuerySynonym_result) getQuerySynonym_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [titancaesar.thrift.caesar.dto.ttypes.QuerySynonymResult, None], False), None, ), # 0 ) class caesarCommonQuery_args(object): """ Attributes: - ctx - caesarCommonRequest """ def __init__(self, ctx=None, caesarCommonRequest=None,): self.ctx = ctx self.caesarCommonRequest = caesarCommonRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.ctx = Context() self.ctx.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.caesarCommonRequest = titancaesar.thrift.caesar.dto.ttypes.CaesarCommonRequest() self.caesarCommonRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('caesarCommonQuery_args') if self.ctx is not None: oprot.writeFieldBegin('ctx', TType.STRUCT, 1) self.ctx.write(oprot) oprot.writeFieldEnd() if self.caesarCommonRequest is not None: oprot.writeFieldBegin('caesarCommonRequest', TType.STRUCT, 2) self.caesarCommonRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.ctx is None: raise TProtocolException(message='Required field ctx is unset!') if self.caesarCommonRequest is None: raise TProtocolException(message='Required field caesarCommonRequest is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(caesarCommonQuery_args) caesarCommonQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'ctx', [Context, None], None, ), # 1 (2, TType.STRUCT, 'caesarCommonRequest', [titancaesar.thrift.caesar.dto.ttypes.CaesarCommonRequest, None], None, ), # 2 ) class caesarCommonQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = titancaesar.thrift.caesar.dto.ttypes.CaesarCommonResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('caesarCommonQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(caesarCommonQuery_result) caesarCommonQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [titancaesar.thrift.caesar.dto.ttypes.CaesarCommonResponse, None], None, ), # 0 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/resources/titancaesar/thrift/caesar/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import titancaesar.thrift.caesar.dto.ttypes from thrift.transport import TTransport all_structs = [] class Context(object): """ Attributes: - traceID: open tracing trace id - clientHost: the caller's host (IP or hostname) - baggage: open tracing baggae, can be used to carry custom loads - spanID: open tracing span id - sampled: whether the very request is sampled - parentSpanID: open tracing parent span ID - userID: userID for log coloring """ def __init__(self, traceID=None, clientHost=None, baggage=None, spanID=None, sampled=None, parentSpanID=None, userID=None,): self.traceID = traceID self.clientHost = clientHost self.baggage = baggage self.spanID = spanID self.sampled = sampled self.parentSpanID = parentSpanID self.userID = userID def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.traceID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.clientHost = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.baggage = {} (_ktype1, _vtype2, _size0) = iprot.readMapBegin() for _i4 in range(_size0): _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val6 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.baggage[_key5] = _val6 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.spanID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.sampled = iprot.readBool() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.parentSpanID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.userID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Context') if self.traceID is not None: oprot.writeFieldBegin('traceID', TType.STRING, 1) oprot.writeString(self.traceID.encode('utf-8') if sys.version_info[0] == 2 else self.traceID) oprot.writeFieldEnd() if self.clientHost is not None: oprot.writeFieldBegin('clientHost', TType.STRING, 2) oprot.writeString(self.clientHost.encode('utf-8') if sys.version_info[0] == 2 else self.clientHost) oprot.writeFieldEnd() if self.baggage is not None: oprot.writeFieldBegin('baggage', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.baggage)) for kiter7, viter8 in self.baggage.items(): oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7) oprot.writeString(viter8.encode('utf-8') if sys.version_info[0] == 2 else viter8) oprot.writeMapEnd() oprot.writeFieldEnd() if self.spanID is not None: oprot.writeFieldBegin('spanID', TType.STRING, 4) oprot.writeString(self.spanID.encode('utf-8') if sys.version_info[0] == 2 else self.spanID) oprot.writeFieldEnd() if self.sampled is not None: oprot.writeFieldBegin('sampled', TType.BOOL, 5) oprot.writeBool(self.sampled) oprot.writeFieldEnd() if self.parentSpanID is not None: oprot.writeFieldBegin('parentSpanID', TType.STRING, 6) oprot.writeString(self.parentSpanID.encode('utf-8') if sys.version_info[0] == 2 else self.parentSpanID) oprot.writeFieldEnd() if self.userID is not None: oprot.writeFieldBegin('userID', TType.STRING, 7) oprot.writeString(self.userID.encode('utf-8') if sys.version_info[0] == 2 else self.userID) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Context) Context.thrift_spec = ( None, # 0 (1, TType.STRING, 'traceID', 'UTF8', None, ), # 1 (2, TType.STRING, 'clientHost', 'UTF8', None, ), # 2 (3, TType.MAP, 'baggage', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRING, 'spanID', 'UTF8', None, ), # 4 (5, TType.BOOL, 'sampled', None, None, ), # 5 (6, TType.STRING, 'parentSpanID', 'UTF8', None, ), # 6 (7, TType.STRING, 'userID', 'UTF8', None, ), # 7 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/resources/titancaesar/__init__.py ===== ===== /workspace/red_serving_py_plugins/resources/titancaesar/base/base_inference.py ===== # -*- coding: utf-8 -*- import os import json import yaml import time import torch import traceback import MetricLogger import numpy as np from titancaesar.thrift.caesar.UtCaesarService import * # required to be found in globals() map from base_inference import BaseInference as RedservingBaseInference from red_serving_def import DeserializeThrift ## 注册BaseInference对象,用于解决staticmethod无法访问私有变量的问题 class Register(object): obj = None @staticmethod def register(obj): Register.obj = obj @staticmethod def get_obj(): return Register.obj @staticmethod def get_logger(): return Register.obj.get_logger() class BaseInference(RedservingBaseInference): metric_logger = MetricLogger.MetricLogger("caesarsuki", "jinjiabao") tags = { "service_name": os.environ.get('XHS_SERVICE', 'xhs'), "type": "rpc", # "model": bls_name, "application": os.environ.get('APPID', 'xhs'), "env": os.environ.get('XHS_ENV', 'xhs'), "zone": os.environ.get('XHS_ZONE', 'xhs'), "cluster": os.environ.get('DEPLOY', 'xhs'), } def __init__(self, inference_path): super().__init__() bls_name = os.path.dirname(inference_path).split('/')[-1] self.logger.error("bls_name: {}".format(bls_name)) BaseInference.tags["model"] = bls_name idx = inference_path.rfind("/") inference_path = inference_path[0:idx] self.logger.error("inference_path: {}".format(inference_path)) config_path = os.path.join(inference_path, 'config.yaml') if not os.path.exists(config_path): self.logger.error("config_path: {}".format(config_path)) with open(config_path, 'r', encoding='utf-8') as file: self.config = yaml.safe_load(file) self.logger.error("config: {}".format(self.config)) Register.register(self) def get_logger(self,): return self.logger def set_init_args(self, args): self.tmp_args = args def execute(self, request): return None @RedservingBaseInference.reset_helper def bls_main(self, request): titan_dtype = self.req_helper.get_titan_dtype() if titan_dtype is None: return self.res_helper.generate_response_and_return(terminate=True) try: raw_input = self.req_helper.get_raw_input() titan_request = DeserializeThrift(raw_input, globals()[titan_dtype]) titan_response = self.execute(titan_request) if titan_response is None: raise Exception("response is None, request: {}, response: {}".format(request, titan_response)) self.res_helper.set_rpc_response(titan_response) return self.res_helper.generate_response_and_return() except: self.logger.error("In bls_main occur exception, exception: {}".format(traceback.format_exc())) return self.res_helper.generate_response_and_return(terminate=True) @staticmethod def convert_to_torch_tensor(tensor, device="cpu"): logger = Register.get_logger() if isinstance(tensor, torch.Tensor): return tensor if isinstance(tensor, np.ndarray): if device == "cpu": return torch.from_numpy(tensor) elif device == "gpu": return torch.from_numpy(tensor).cuda() else: logger.error("device type {} not support! Now cpu and gpu are supported".format(device)) logger.error("tensor type: {} not support!".format(type(tensor))) return tensor ## 现在没有pb_tensor,为了兼容老版本,保留此接口 @staticmethod def pb_tensor_to_numpy(pb_tensor): return tensor_to_numpy(pb_tensor) @staticmethod def tensor_to_numpy(tensor): if isinstance(tensor, np.ndarray): return tensor if tensor.is_cuda: return tensor.cpu().numpy() else: return tensor.numpy() @staticmethod def metricLogger(values, type, tags=None): if tags is not None: tags.update(BaseInference.tags) else: tags = BaseInference.tags if type == "value": BaseInference.metric_logger.sendValue(values, tags=tags) elif type == "counter": BaseInference.metric_logger.sendCounter(values, tags=tags) @staticmethod def calTimeCost(time_list): result = [] if len(time_list)<=1: return result for i in range(1,len(time_list)): result.append(time_list[i]-time_list[i-1]) result.append(time_list[len(time_list)-1]-time_list[0]) return result @staticmethod def infer(model_name, model_inputs, output_names): start_time = time.time() logger = Register.get_logger() obj = Register.get_obj() model_output = obj.forward(model_name, model_inputs) end_time = time.time() BaseInference.metricLogger({ "model_latency": (end_time - start_time) * 1000 }, type="value" ,tags=BaseInference.tags) response = [] try: if model_output is not None and len(model_output) == len(output_names): for output_name in output_names: response.append(model_output[output_name]) else: raise Exception("model_output is None") except: logger.error(traceback.format_exc()) logger.error("output_names: {}, model_output: {}".format(output_names, model_output)) return response class NpEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, np.integer): return int(obj) if isinstance(obj, np.floating): return float(obj) if isinstance(obj, np.bool_): return bool(obj) if isinstance(obj, np.ndarray): return obj.tolist() return super(NpEncoder, self).default(obj) ===== /workspace/red_serving_py_plugins/resources/titancaesar/base/model_config_pb2.py ===== # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: model_config.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='model_config.proto', package='inference', syntax='proto3', serialized_options=None, serialized_pb=_b('\n\x12model_config.proto\x12\tinference\"\x96\x01\n\x10ModelRateLimiter\x12\x37\n\tresources\x18\x01 \x03(\x0b\x32$.inference.ModelRateLimiter.Resource\x12\x10\n\x08priority\x18\x02 \x01(\r\x1a\x37\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06global\x18\x02 \x01(\x08\x12\r\n\x05\x63ount\x18\x03 \x01(\r\"\x87\x04\n\x12ModelInstanceGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x30\n\x04kind\x18\x04 \x01(\x0e\x32\".inference.ModelInstanceGroup.Kind\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x12\x31\n\x0crate_limiter\x18\x06 \x01(\x0b\x32\x1b.inference.ModelRateLimiter\x12\x0c\n\x04gpus\x18\x03 \x03(\x05\x12H\n\x11secondary_devices\x18\x08 \x03(\x0b\x32-.inference.ModelInstanceGroup.SecondaryDevice\x12\x0f\n\x07profile\x18\x05 \x03(\t\x12\x0f\n\x07passive\x18\x07 \x01(\x08\x12\x13\n\x0bhost_policy\x18\t \x01(\t\x1a\x9c\x01\n\x0fSecondaryDevice\x12O\n\x04kind\x18\x01 \x01(\x0e\x32\x41.inference.ModelInstanceGroup.SecondaryDevice.SecondaryDeviceKind\x12\x11\n\tdevice_id\x18\x02 \x01(\x03\"%\n\x13SecondaryDeviceKind\x12\x0e\n\nKIND_NVDLA\x10\x00\"A\n\x04Kind\x12\r\n\tKIND_AUTO\x10\x00\x12\x0c\n\x08KIND_GPU\x10\x01\x12\x0c\n\x08KIND_CPU\x10\x02\x12\x0e\n\nKIND_MODEL\x10\x03\"#\n\x12ModelTensorReshape\x12\r\n\x05shape\x18\x01 \x03(\x03\"\xb2\x02\n\nModelInput\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\tdata_type\x18\x02 \x01(\x0e\x32\x13.inference.DataType\x12,\n\x06\x66ormat\x18\x03 \x01(\x0e\x32\x1c.inference.ModelInput.Format\x12\x0c\n\x04\x64ims\x18\x04 \x03(\x03\x12.\n\x07reshape\x18\x05 \x01(\x0b\x32\x1d.inference.ModelTensorReshape\x12\x17\n\x0fis_shape_tensor\x18\x06 \x01(\x08\x12\x1a\n\x12\x61llow_ragged_batch\x18\x07 \x01(\x08\x12\x10\n\x08optional\x18\x08 \x01(\x08\";\n\x06\x46ormat\x12\x0f\n\x0b\x46ORMAT_NONE\x10\x00\x12\x0f\n\x0b\x46ORMAT_NHWC\x10\x01\x12\x0f\n\x0b\x46ORMAT_NCHW\x10\x02\"\xb2\x01\n\x0bModelOutput\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\tdata_type\x18\x02 \x01(\x0e\x32\x13.inference.DataType\x12\x0c\n\x04\x64ims\x18\x03 \x03(\x03\x12.\n\x07reshape\x18\x05 \x01(\x0b\x32\x1d.inference.ModelTensorReshape\x12\x16\n\x0elabel_filename\x18\x04 \x01(\t\x12\x17\n\x0fis_shape_tensor\x18\x06 \x01(\x08\"\xd9\x02\n\nBatchInput\x12(\n\x04kind\x18\x01 \x01(\x0e\x32\x1a.inference.BatchInput.Kind\x12\x13\n\x0btarget_name\x18\x02 \x03(\t\x12&\n\tdata_type\x18\x03 \x01(\x0e\x32\x13.inference.DataType\x12\x14\n\x0csource_input\x18\x04 \x03(\t\"\xcd\x01\n\x04Kind\x12\x17\n\x13\x42\x41TCH_ELEMENT_COUNT\x10\x00\x12#\n\x1f\x42\x41TCH_ACCUMULATED_ELEMENT_COUNT\x10\x01\x12-\n)BATCH_ACCUMULATED_ELEMENT_COUNT_WITH_ZERO\x10\x02\x12$\n BATCH_MAX_ELEMENT_COUNT_AS_SHAPE\x10\x03\x12\x14\n\x10\x42\x41TCH_ITEM_SHAPE\x10\x04\x12\x1c\n\x18\x42\x41TCH_ITEM_SHAPE_FLATTEN\x10\x05\"\x8f\x01\n\x0b\x42\x61tchOutput\x12\x13\n\x0btarget_name\x18\x01 \x03(\t\x12)\n\x04kind\x18\x02 \x01(\x0e\x32\x1b.inference.BatchOutput.Kind\x12\x14\n\x0csource_input\x18\x03 \x03(\t\"*\n\x04Kind\x12\"\n\x1e\x42\x41TCH_SCATTER_WITH_INPUT_SHAPE\x10\x00\"\x90\x02\n\x12ModelVersionPolicy\x12\x36\n\x06latest\x18\x01 \x01(\x0b\x32$.inference.ModelVersionPolicy.LatestH\x00\x12\x30\n\x03\x61ll\x18\x02 \x01(\x0b\x32!.inference.ModelVersionPolicy.AllH\x00\x12:\n\x08specific\x18\x03 \x01(\x0b\x32&.inference.ModelVersionPolicy.SpecificH\x00\x1a\x1e\n\x06Latest\x12\x14\n\x0cnum_versions\x18\x01 \x01(\r\x1a\x05\n\x03\x41ll\x1a\x1c\n\x08Specific\x12\x10\n\x08versions\x18\x01 \x03(\x03\x42\x0f\n\rpolicy_choice\"\xfd\r\n\x17ModelOptimizationPolicy\x12\x37\n\x05graph\x18\x01 \x01(\x0b\x32(.inference.ModelOptimizationPolicy.Graph\x12\x42\n\x08priority\x18\x02 \x01(\x0e\x32\x30.inference.ModelOptimizationPolicy.ModelPriority\x12\x35\n\x04\x63uda\x18\x03 \x01(\x0b\x32\'.inference.ModelOptimizationPolicy.Cuda\x12X\n\x16\x65xecution_accelerators\x18\x04 \x01(\x0b\x32\x38.inference.ModelOptimizationPolicy.ExecutionAccelerators\x12R\n\x13input_pinned_memory\x18\x05 \x01(\x0b\x32\x35.inference.ModelOptimizationPolicy.PinnedMemoryBuffer\x12S\n\x14output_pinned_memory\x18\x06 \x01(\x0b\x32\x35.inference.ModelOptimizationPolicy.PinnedMemoryBuffer\x12&\n\x1egather_kernel_buffer_threshold\x18\x07 \x01(\r\x12\x16\n\x0e\x65\x61ger_batching\x18\x08 \x01(\x08\x1a\x16\n\x05Graph\x12\r\n\x05level\x18\x01 \x01(\x05\x1a\xba\x05\n\x04\x43uda\x12\x0e\n\x06graphs\x18\x01 \x01(\x08\x12\x18\n\x10\x62usy_wait_events\x18\x02 \x01(\x08\x12\x45\n\ngraph_spec\x18\x03 \x03(\x0b\x32\x31.inference.ModelOptimizationPolicy.Cuda.GraphSpec\x12\x1a\n\x12output_copy_stream\x18\x04 \x01(\x08\x1a\xa4\x04\n\tGraphSpec\x12\x12\n\nbatch_size\x18\x01 \x01(\x05\x12K\n\x05input\x18\x02 \x03(\x0b\x32<.inference.ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry\x12W\n\x11graph_lower_bound\x18\x03 \x01(\x0b\x32<.inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound\x1a\x14\n\x05Shape\x12\x0b\n\x03\x64im\x18\x01 \x03(\x03\x1a\xdf\x01\n\nLowerBound\x12\x12\n\nbatch_size\x18\x01 \x01(\x05\x12V\n\x05input\x18\x02 \x03(\x0b\x32G.inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry\x1a\x65\n\nInputEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x46\n\x05value\x18\x02 \x01(\x0b\x32\x37.inference.ModelOptimizationPolicy.Cuda.GraphSpec.Shape:\x02\x38\x01\x1a\x65\n\nInputEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x46\n\x05value\x18\x02 \x01(\x0b\x32\x37.inference.ModelOptimizationPolicy.Cuda.GraphSpec.Shape:\x02\x38\x01\x1a\xa4\x03\n\x15\x45xecutionAccelerators\x12g\n\x19gpu_execution_accelerator\x18\x01 \x03(\x0b\x32\x44.inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator\x12g\n\x19\x63pu_execution_accelerator\x18\x02 \x03(\x0b\x32\x44.inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator\x1a\xb8\x01\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12h\n\nparameters\x18\x02 \x03(\x0b\x32T.inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a$\n\x12PinnedMemoryBuffer\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\"I\n\rModelPriority\x12\x14\n\x10PRIORITY_DEFAULT\x10\x00\x12\x10\n\x0cPRIORITY_MAX\x10\x01\x12\x10\n\x0cPRIORITY_MIN\x10\x02\"\xdb\x01\n\x10ModelQueuePolicy\x12\x41\n\x0etimeout_action\x18\x01 \x01(\x0e\x32).inference.ModelQueuePolicy.TimeoutAction\x12$\n\x1c\x64\x65\x66\x61ult_timeout_microseconds\x18\x02 \x01(\x04\x12\x1e\n\x16\x61llow_timeout_override\x18\x03 \x01(\x08\x12\x16\n\x0emax_queue_size\x18\x04 \x01(\r\"&\n\rTimeoutAction\x12\n\n\x06REJECT\x10\x00\x12\t\n\x05\x44\x45LAY\x10\x01\"\x9b\x03\n\x14ModelDynamicBatching\x12\x1c\n\x14preferred_batch_size\x18\x01 \x03(\x05\x12$\n\x1cmax_queue_delay_microseconds\x18\x02 \x01(\x04\x12\x19\n\x11preserve_ordering\x18\x03 \x01(\x08\x12\x17\n\x0fpriority_levels\x18\x04 \x01(\r\x12\x1e\n\x16\x64\x65\x66\x61ult_priority_level\x18\x05 \x01(\r\x12\x39\n\x14\x64\x65\x66\x61ult_queue_policy\x18\x06 \x01(\x0b\x32\x1b.inference.ModelQueuePolicy\x12W\n\x15priority_queue_policy\x18\x07 \x03(\x0b\x32\x38.inference.ModelDynamicBatching.PriorityQueuePolicyEntry\x1aW\n\x18PriorityQueuePolicyEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.inference.ModelQueuePolicy:\x02\x38\x01\"\xef\t\n\x15ModelSequenceBatching\x12\x41\n\x06\x64irect\x18\x03 \x01(\x0b\x32/.inference.ModelSequenceBatching.StrategyDirectH\x00\x12\x41\n\x06oldest\x18\x04 \x01(\x0b\x32/.inference.ModelSequenceBatching.StrategyOldestH\x00\x12&\n\x1emax_sequence_idle_microseconds\x18\x01 \x01(\x04\x12\x44\n\rcontrol_input\x18\x02 \x03(\x0b\x32-.inference.ModelSequenceBatching.ControlInput\x12\x35\n\x05state\x18\x05 \x03(\x0b\x32&.inference.ModelSequenceBatching.State\x1a\xb1\x02\n\x07\x43ontrol\x12;\n\x04kind\x18\x01 \x01(\x0e\x32-.inference.ModelSequenceBatching.Control.Kind\x12\x18\n\x10int32_false_true\x18\x02 \x03(\x05\x12\x17\n\x0f\x66p32_false_true\x18\x03 \x03(\x02\x12\x17\n\x0f\x62ool_false_true\x18\x05 \x03(\x08\x12&\n\tdata_type\x18\x04 \x01(\x0e\x32\x13.inference.DataType\"u\n\x04Kind\x12\x1a\n\x16\x43ONTROL_SEQUENCE_START\x10\x00\x12\x1a\n\x16\x43ONTROL_SEQUENCE_READY\x10\x01\x12\x18\n\x14\x43ONTROL_SEQUENCE_END\x10\x02\x12\x1b\n\x17\x43ONTROL_SEQUENCE_CORRID\x10\x03\x1aW\n\x0c\x43ontrolInput\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x07\x63ontrol\x18\x02 \x03(\x0b\x32(.inference.ModelSequenceBatching.Control\x1a\x8a\x01\n\x0cInitialState\x12&\n\tdata_type\x18\x01 \x01(\x0e\x32\x13.inference.DataType\x12\x0c\n\x04\x64ims\x18\x02 \x03(\x03\x12\x13\n\tzero_data\x18\x03 \x01(\x08H\x00\x12\x13\n\tdata_file\x18\x04 \x01(\tH\x00\x12\x0c\n\x04name\x18\x05 \x01(\tB\x0c\n\nstate_data\x1a\xac\x01\n\x05State\x12\x12\n\ninput_name\x18\x01 \x01(\t\x12\x13\n\x0boutput_name\x18\x02 \x01(\t\x12&\n\tdata_type\x18\x03 \x01(\x0e\x32\x13.inference.DataType\x12\x0c\n\x04\x64ims\x18\x04 \x03(\x03\x12\x44\n\rinitial_state\x18\x05 \x03(\x0b\x32-.inference.ModelSequenceBatching.InitialState\x1aX\n\x0eStrategyDirect\x12$\n\x1cmax_queue_delay_microseconds\x18\x01 \x01(\x04\x12 \n\x18minimum_slot_utilization\x18\x02 \x01(\x02\x1au\n\x0eStrategyOldest\x12\x1f\n\x17max_candidate_sequences\x18\x01 \x01(\x05\x12\x1c\n\x14preferred_batch_size\x18\x02 \x03(\x05\x12$\n\x1cmax_queue_delay_microseconds\x18\x03 \x01(\x04\x42\x11\n\x0fstrategy_choice\"\xdd\x02\n\x0fModelEnsembling\x12-\n\x04step\x18\x01 \x03(\x0b\x32\x1f.inference.ModelEnsembling.Step\x1a\x9a\x02\n\x04Step\x12\x12\n\nmodel_name\x18\x01 \x01(\t\x12\x15\n\rmodel_version\x18\x02 \x01(\x03\x12@\n\tinput_map\x18\x03 \x03(\x0b\x32-.inference.ModelEnsembling.Step.InputMapEntry\x12\x42\n\noutput_map\x18\x04 \x03(\x0b\x32..inference.ModelEnsembling.Step.OutputMapEntry\x1a/\n\rInputMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x30\n\x0eOutputMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"&\n\x0eModelParameter\x12\x14\n\x0cstring_value\x18\x01 \x01(\t\"\xd9\x02\n\x0bModelWarmup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nbatch_size\x18\x02 \x01(\r\x12\x32\n\x06inputs\x18\x03 \x03(\x0b\x32\".inference.ModelWarmup.InputsEntry\x12\r\n\x05\x63ount\x18\x04 \x01(\r\x1a\x97\x01\n\x05Input\x12&\n\tdata_type\x18\x01 \x01(\x0e\x32\x13.inference.DataType\x12\x0c\n\x04\x64ims\x18\x02 \x03(\x03\x12\x13\n\tzero_data\x18\x03 \x01(\x08H\x00\x12\x15\n\x0brandom_data\x18\x04 \x01(\x08H\x00\x12\x19\n\x0finput_data_file\x18\x05 \x01(\tH\x00\x42\x11\n\x0finput_data_type\x1aK\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.inference.ModelWarmup.Input:\x02\x38\x01\".\n\x0fModelOperations\x12\x1b\n\x13op_library_filename\x18\x01 \x03(\t\"+\n\x16ModelTransactionPolicy\x12\x11\n\tdecoupled\x18\x01 \x01(\x08\"\xe6\x01\n\x15ModelRepositoryAgents\x12\x36\n\x06\x61gents\x18\x01 \x03(\x0b\x32&.inference.ModelRepositoryAgents.Agent\x1a\x94\x01\n\x05\x41gent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12J\n\nparameters\x18\x02 \x03(\x0b\x32\x36.inference.ModelRepositoryAgents.Agent.ParametersEntry\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"$\n\x12ModelResponseCache\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\"\xb2\n\n\x0bModelConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08platform\x18\x02 \x01(\t\x12\x0f\n\x07\x62\x61\x63kend\x18\x11 \x01(\t\x12\x35\n\x0eversion_policy\x18\x03 \x01(\x0b\x32\x1d.inference.ModelVersionPolicy\x12\x16\n\x0emax_batch_size\x18\x04 \x01(\x05\x12$\n\x05input\x18\x05 \x03(\x0b\x32\x15.inference.ModelInput\x12&\n\x06output\x18\x06 \x03(\x0b\x32\x16.inference.ModelOutput\x12*\n\x0b\x62\x61tch_input\x18\x14 \x03(\x0b\x32\x15.inference.BatchInput\x12,\n\x0c\x62\x61tch_output\x18\x15 \x03(\x0b\x32\x16.inference.BatchOutput\x12\x38\n\x0coptimization\x18\x0c \x01(\x0b\x32\".inference.ModelOptimizationPolicy\x12;\n\x10\x64ynamic_batching\x18\x0b \x01(\x0b\x32\x1f.inference.ModelDynamicBatchingH\x00\x12=\n\x11sequence_batching\x18\r \x01(\x0b\x32 .inference.ModelSequenceBatchingH\x00\x12\x39\n\x13\x65nsemble_scheduling\x18\x0f \x01(\x0b\x32\x1a.inference.ModelEnsemblingH\x00\x12\x35\n\x0einstance_group\x18\x07 \x03(\x0b\x32\x1d.inference.ModelInstanceGroup\x12\x1e\n\x16\x64\x65\x66\x61ult_model_filename\x18\x08 \x01(\t\x12H\n\x12\x63\x63_model_filenames\x18\t \x03(\x0b\x32,.inference.ModelConfig.CcModelFilenamesEntry\x12;\n\x0bmetric_tags\x18\n \x03(\x0b\x32&.inference.ModelConfig.MetricTagsEntry\x12:\n\nparameters\x18\x0e \x03(\x0b\x32&.inference.ModelConfig.ParametersEntry\x12,\n\x0cmodel_warmup\x18\x10 \x03(\x0b\x32\x16.inference.ModelWarmup\x12\x34\n\x10model_operations\x18\x12 \x01(\x0b\x32\x1a.inference.ModelOperations\x12\x43\n\x18model_transaction_policy\x18\x13 \x01(\x0b\x32!.inference.ModelTransactionPolicy\x12\x41\n\x17model_repository_agents\x18\x17 \x01(\x0b\x32 .inference.ModelRepositoryAgents\x12\x35\n\x0eresponse_cache\x18\x18 \x01(\x0b\x32\x1d.inference.ModelResponseCache\x1a\x37\n\x15\x43\x63ModelFilenamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fMetricTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.ModelParameter:\x02\x38\x01\x42\x13\n\x11scheduling_choice*\xfa\x01\n\x08\x44\x61taType\x12\x10\n\x0cTYPE_INVALID\x10\x00\x12\r\n\tTYPE_BOOL\x10\x01\x12\x0e\n\nTYPE_UINT8\x10\x02\x12\x0f\n\x0bTYPE_UINT16\x10\x03\x12\x0f\n\x0bTYPE_UINT32\x10\x04\x12\x0f\n\x0bTYPE_UINT64\x10\x05\x12\r\n\tTYPE_INT8\x10\x06\x12\x0e\n\nTYPE_INT16\x10\x07\x12\x0e\n\nTYPE_INT32\x10\x08\x12\x0e\n\nTYPE_INT64\x10\t\x12\r\n\tTYPE_FP16\x10\n\x12\r\n\tTYPE_FP32\x10\x0b\x12\r\n\tTYPE_FP64\x10\x0c\x12\x0f\n\x0bTYPE_STRING\x10\r\x12\r\n\tTYPE_BF16\x10\x0e\x62\x06proto3') ) _DATATYPE = _descriptor.EnumDescriptor( name='DataType', full_name='inference.DataType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='TYPE_INVALID', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_BOOL', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_UINT8', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_UINT16', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_UINT32', index=4, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_UINT64', index=5, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_INT8', index=6, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_INT16', index=7, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_INT32', index=8, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_INT64', index=9, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_FP16', index=10, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_FP32', index=11, number=11, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_FP64', index=12, number=12, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_STRING', index=13, number=13, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TYPE_BF16', index=14, number=14, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=8136, serialized_end=8386, ) _sym_db.RegisterEnumDescriptor(_DATATYPE) DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) TYPE_INVALID = 0 TYPE_BOOL = 1 TYPE_UINT8 = 2 TYPE_UINT16 = 3 TYPE_UINT32 = 4 TYPE_UINT64 = 5 TYPE_INT8 = 6 TYPE_INT16 = 7 TYPE_INT32 = 8 TYPE_INT64 = 9 TYPE_FP16 = 10 TYPE_FP32 = 11 TYPE_FP64 = 12 TYPE_STRING = 13 TYPE_BF16 = 14 _MODELINSTANCEGROUP_SECONDARYDEVICE_SECONDARYDEVICEKIND = _descriptor.EnumDescriptor( name='SecondaryDeviceKind', full_name='inference.ModelInstanceGroup.SecondaryDevice.SecondaryDeviceKind', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='KIND_NVDLA', index=0, number=0, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=602, serialized_end=639, ) _sym_db.RegisterEnumDescriptor(_MODELINSTANCEGROUP_SECONDARYDEVICE_SECONDARYDEVICEKIND) _MODELINSTANCEGROUP_KIND = _descriptor.EnumDescriptor( name='Kind', full_name='inference.ModelInstanceGroup.Kind', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='KIND_AUTO', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='KIND_GPU', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='KIND_CPU', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='KIND_MODEL', index=3, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=641, serialized_end=706, ) _sym_db.RegisterEnumDescriptor(_MODELINSTANCEGROUP_KIND) _MODELINPUT_FORMAT = _descriptor.EnumDescriptor( name='Format', full_name='inference.ModelInput.Format', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='FORMAT_NONE', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='FORMAT_NHWC', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='FORMAT_NCHW', index=2, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=993, serialized_end=1052, ) _sym_db.RegisterEnumDescriptor(_MODELINPUT_FORMAT) _BATCHINPUT_KIND = _descriptor.EnumDescriptor( name='Kind', full_name='inference.BatchInput.Kind', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='BATCH_ELEMENT_COUNT', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BATCH_ACCUMULATED_ELEMENT_COUNT', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BATCH_ACCUMULATED_ELEMENT_COUNT_WITH_ZERO', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BATCH_MAX_ELEMENT_COUNT_AS_SHAPE', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BATCH_ITEM_SHAPE', index=4, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BATCH_ITEM_SHAPE_FLATTEN', index=5, number=5, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1376, serialized_end=1581, ) _sym_db.RegisterEnumDescriptor(_BATCHINPUT_KIND) _BATCHOUTPUT_KIND = _descriptor.EnumDescriptor( name='Kind', full_name='inference.BatchOutput.Kind', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='BATCH_SCATTER_WITH_INPUT_SHAPE', index=0, number=0, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1685, serialized_end=1727, ) _sym_db.RegisterEnumDescriptor(_BATCHOUTPUT_KIND) _MODELOPTIMIZATIONPOLICY_MODELPRIORITY = _descriptor.EnumDescriptor( name='ModelPriority', full_name='inference.ModelOptimizationPolicy.ModelPriority', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='PRIORITY_DEFAULT', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PRIORITY_MAX', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PRIORITY_MIN', index=2, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=3721, serialized_end=3794, ) _sym_db.RegisterEnumDescriptor(_MODELOPTIMIZATIONPOLICY_MODELPRIORITY) _MODELQUEUEPOLICY_TIMEOUTACTION = _descriptor.EnumDescriptor( name='TimeoutAction', full_name='inference.ModelQueuePolicy.TimeoutAction', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='REJECT', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DELAY', index=1, number=1, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=3978, serialized_end=4016, ) _sym_db.RegisterEnumDescriptor(_MODELQUEUEPOLICY_TIMEOUTACTION) _MODELSEQUENCEBATCHING_CONTROL_KIND = _descriptor.EnumDescriptor( name='Kind', full_name='inference.ModelSequenceBatching.Control.Kind', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='CONTROL_SEQUENCE_START', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CONTROL_SEQUENCE_READY', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CONTROL_SEQUENCE_END', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CONTROL_SEQUENCE_CORRID', index=3, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=4946, serialized_end=5063, ) _sym_db.RegisterEnumDescriptor(_MODELSEQUENCEBATCHING_CONTROL_KIND) _MODELRATELIMITER_RESOURCE = _descriptor.Descriptor( name='Resource', full_name='inference.ModelRateLimiter.Resource', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelRateLimiter.Resource.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='global', full_name='inference.ModelRateLimiter.Resource.global', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='count', full_name='inference.ModelRateLimiter.Resource.count', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=129, serialized_end=184, ) _MODELRATELIMITER = _descriptor.Descriptor( name='ModelRateLimiter', full_name='inference.ModelRateLimiter', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='resources', full_name='inference.ModelRateLimiter.resources', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='priority', full_name='inference.ModelRateLimiter.priority', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELRATELIMITER_RESOURCE, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=34, serialized_end=184, ) _MODELINSTANCEGROUP_SECONDARYDEVICE = _descriptor.Descriptor( name='SecondaryDevice', full_name='inference.ModelInstanceGroup.SecondaryDevice', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='kind', full_name='inference.ModelInstanceGroup.SecondaryDevice.kind', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='inference.ModelInstanceGroup.SecondaryDevice.device_id', index=1, number=2, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _MODELINSTANCEGROUP_SECONDARYDEVICE_SECONDARYDEVICEKIND, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=483, serialized_end=639, ) _MODELINSTANCEGROUP = _descriptor.Descriptor( name='ModelInstanceGroup', full_name='inference.ModelInstanceGroup', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelInstanceGroup.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='inference.ModelInstanceGroup.kind', index=1, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='count', full_name='inference.ModelInstanceGroup.count', index=2, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rate_limiter', full_name='inference.ModelInstanceGroup.rate_limiter', index=3, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gpus', full_name='inference.ModelInstanceGroup.gpus', index=4, number=3, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='secondary_devices', full_name='inference.ModelInstanceGroup.secondary_devices', index=5, number=8, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='profile', full_name='inference.ModelInstanceGroup.profile', index=6, number=5, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='passive', full_name='inference.ModelInstanceGroup.passive', index=7, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='host_policy', full_name='inference.ModelInstanceGroup.host_policy', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELINSTANCEGROUP_SECONDARYDEVICE, ], enum_types=[ _MODELINSTANCEGROUP_KIND, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=187, serialized_end=706, ) _MODELTENSORRESHAPE = _descriptor.Descriptor( name='ModelTensorReshape', full_name='inference.ModelTensorReshape', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='shape', full_name='inference.ModelTensorReshape.shape', index=0, number=1, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=708, serialized_end=743, ) _MODELINPUT = _descriptor.Descriptor( name='ModelInput', full_name='inference.ModelInput', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelInput.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelInput.data_type', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='format', full_name='inference.ModelInput.format', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dims', full_name='inference.ModelInput.dims', index=3, number=4, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='reshape', full_name='inference.ModelInput.reshape', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='is_shape_tensor', full_name='inference.ModelInput.is_shape_tensor', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='allow_ragged_batch', full_name='inference.ModelInput.allow_ragged_batch', index=6, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='optional', full_name='inference.ModelInput.optional', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _MODELINPUT_FORMAT, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=746, serialized_end=1052, ) _MODELOUTPUT = _descriptor.Descriptor( name='ModelOutput', full_name='inference.ModelOutput', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelOutput.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelOutput.data_type', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dims', full_name='inference.ModelOutput.dims', index=2, number=3, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='reshape', full_name='inference.ModelOutput.reshape', index=3, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='label_filename', full_name='inference.ModelOutput.label_filename', index=4, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='is_shape_tensor', full_name='inference.ModelOutput.is_shape_tensor', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1055, serialized_end=1233, ) _BATCHINPUT = _descriptor.Descriptor( name='BatchInput', full_name='inference.BatchInput', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='kind', full_name='inference.BatchInput.kind', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='target_name', full_name='inference.BatchInput.target_name', index=1, number=2, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_type', full_name='inference.BatchInput.data_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='source_input', full_name='inference.BatchInput.source_input', index=3, number=4, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _BATCHINPUT_KIND, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1236, serialized_end=1581, ) _BATCHOUTPUT = _descriptor.Descriptor( name='BatchOutput', full_name='inference.BatchOutput', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='target_name', full_name='inference.BatchOutput.target_name', index=0, number=1, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='inference.BatchOutput.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='source_input', full_name='inference.BatchOutput.source_input', index=2, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _BATCHOUTPUT_KIND, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1584, serialized_end=1727, ) _MODELVERSIONPOLICY_LATEST = _descriptor.Descriptor( name='Latest', full_name='inference.ModelVersionPolicy.Latest', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='num_versions', full_name='inference.ModelVersionPolicy.Latest.num_versions', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1918, serialized_end=1948, ) _MODELVERSIONPOLICY_ALL = _descriptor.Descriptor( name='All', full_name='inference.ModelVersionPolicy.All', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1950, serialized_end=1955, ) _MODELVERSIONPOLICY_SPECIFIC = _descriptor.Descriptor( name='Specific', full_name='inference.ModelVersionPolicy.Specific', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='versions', full_name='inference.ModelVersionPolicy.Specific.versions', index=0, number=1, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1957, serialized_end=1985, ) _MODELVERSIONPOLICY = _descriptor.Descriptor( name='ModelVersionPolicy', full_name='inference.ModelVersionPolicy', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='latest', full_name='inference.ModelVersionPolicy.latest', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='all', full_name='inference.ModelVersionPolicy.all', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='specific', full_name='inference.ModelVersionPolicy.specific', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELVERSIONPOLICY_LATEST, _MODELVERSIONPOLICY_ALL, _MODELVERSIONPOLICY_SPECIFIC, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='policy_choice', full_name='inference.ModelVersionPolicy.policy_choice', index=0, containing_type=None, fields=[]), ], serialized_start=1730, serialized_end=2002, ) _MODELOPTIMIZATIONPOLICY_GRAPH = _descriptor.Descriptor( name='Graph', full_name='inference.ModelOptimizationPolicy.Graph', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='level', full_name='inference.ModelOptimizationPolicy.Graph.level', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2535, serialized_end=2557, ) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE = _descriptor.Descriptor( name='Shape', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.Shape', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='dim', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.Shape.dim', index=0, number=1, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2909, serialized_end=2929, ) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY = _descriptor.Descriptor( name='InputEntry', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3054, serialized_end=3155, ) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND = _descriptor.Descriptor( name='LowerBound', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='batch_size', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.batch_size', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.input', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2932, serialized_end=3155, ) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY = _descriptor.Descriptor( name='InputEntry', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3054, serialized_end=3155, ) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC = _descriptor.Descriptor( name='GraphSpec', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='batch_size', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.batch_size', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.input', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='graph_lower_bound', full_name='inference.ModelOptimizationPolicy.Cuda.GraphSpec.graph_lower_bound', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE, _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND, _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2710, serialized_end=3258, ) _MODELOPTIMIZATIONPOLICY_CUDA = _descriptor.Descriptor( name='Cuda', full_name='inference.ModelOptimizationPolicy.Cuda', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='graphs', full_name='inference.ModelOptimizationPolicy.Cuda.graphs', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='busy_wait_events', full_name='inference.ModelOptimizationPolicy.Cuda.busy_wait_events', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='graph_spec', full_name='inference.ModelOptimizationPolicy.Cuda.graph_spec', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='output_copy_stream', full_name='inference.ModelOptimizationPolicy.Cuda.output_copy_stream', index=3, number=4, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2560, serialized_end=3258, ) _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY = _descriptor.Descriptor( name='ParametersEntry', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3632, serialized_end=3681, ) _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR = _descriptor.Descriptor( name='Accelerator', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='parameters', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.parameters', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3497, serialized_end=3681, ) _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS = _descriptor.Descriptor( name='ExecutionAccelerators', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='gpu_execution_accelerator', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.gpu_execution_accelerator', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cpu_execution_accelerator', full_name='inference.ModelOptimizationPolicy.ExecutionAccelerators.cpu_execution_accelerator', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3261, serialized_end=3681, ) _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER = _descriptor.Descriptor( name='PinnedMemoryBuffer', full_name='inference.ModelOptimizationPolicy.PinnedMemoryBuffer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='enable', full_name='inference.ModelOptimizationPolicy.PinnedMemoryBuffer.enable', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3683, serialized_end=3719, ) _MODELOPTIMIZATIONPOLICY = _descriptor.Descriptor( name='ModelOptimizationPolicy', full_name='inference.ModelOptimizationPolicy', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='graph', full_name='inference.ModelOptimizationPolicy.graph', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='priority', full_name='inference.ModelOptimizationPolicy.priority', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cuda', full_name='inference.ModelOptimizationPolicy.cuda', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='execution_accelerators', full_name='inference.ModelOptimizationPolicy.execution_accelerators', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input_pinned_memory', full_name='inference.ModelOptimizationPolicy.input_pinned_memory', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='output_pinned_memory', full_name='inference.ModelOptimizationPolicy.output_pinned_memory', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gather_kernel_buffer_threshold', full_name='inference.ModelOptimizationPolicy.gather_kernel_buffer_threshold', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='eager_batching', full_name='inference.ModelOptimizationPolicy.eager_batching', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELOPTIMIZATIONPOLICY_GRAPH, _MODELOPTIMIZATIONPOLICY_CUDA, _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS, _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER, ], enum_types=[ _MODELOPTIMIZATIONPOLICY_MODELPRIORITY, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2005, serialized_end=3794, ) _MODELQUEUEPOLICY = _descriptor.Descriptor( name='ModelQueuePolicy', full_name='inference.ModelQueuePolicy', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='timeout_action', full_name='inference.ModelQueuePolicy.timeout_action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_timeout_microseconds', full_name='inference.ModelQueuePolicy.default_timeout_microseconds', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='allow_timeout_override', full_name='inference.ModelQueuePolicy.allow_timeout_override', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_queue_size', full_name='inference.ModelQueuePolicy.max_queue_size', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _MODELQUEUEPOLICY_TIMEOUTACTION, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3797, serialized_end=4016, ) _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY = _descriptor.Descriptor( name='PriorityQueuePolicyEntry', full_name='inference.ModelDynamicBatching.PriorityQueuePolicyEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelDynamicBatching.PriorityQueuePolicyEntry.key', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelDynamicBatching.PriorityQueuePolicyEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=4343, serialized_end=4430, ) _MODELDYNAMICBATCHING = _descriptor.Descriptor( name='ModelDynamicBatching', full_name='inference.ModelDynamicBatching', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='preferred_batch_size', full_name='inference.ModelDynamicBatching.preferred_batch_size', index=0, number=1, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_queue_delay_microseconds', full_name='inference.ModelDynamicBatching.max_queue_delay_microseconds', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='preserve_ordering', full_name='inference.ModelDynamicBatching.preserve_ordering', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='priority_levels', full_name='inference.ModelDynamicBatching.priority_levels', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_priority_level', full_name='inference.ModelDynamicBatching.default_priority_level', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_queue_policy', full_name='inference.ModelDynamicBatching.default_queue_policy', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='priority_queue_policy', full_name='inference.ModelDynamicBatching.priority_queue_policy', index=6, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=4019, serialized_end=4430, ) _MODELSEQUENCEBATCHING_CONTROL = _descriptor.Descriptor( name='Control', full_name='inference.ModelSequenceBatching.Control', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='kind', full_name='inference.ModelSequenceBatching.Control.kind', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='int32_false_true', full_name='inference.ModelSequenceBatching.Control.int32_false_true', index=1, number=2, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fp32_false_true', full_name='inference.ModelSequenceBatching.Control.fp32_false_true', index=2, number=3, type=2, cpp_type=6, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bool_false_true', full_name='inference.ModelSequenceBatching.Control.bool_false_true', index=3, number=5, type=8, cpp_type=7, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelSequenceBatching.Control.data_type', index=4, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _MODELSEQUENCEBATCHING_CONTROL_KIND, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=4758, serialized_end=5063, ) _MODELSEQUENCEBATCHING_CONTROLINPUT = _descriptor.Descriptor( name='ControlInput', full_name='inference.ModelSequenceBatching.ControlInput', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelSequenceBatching.ControlInput.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='control', full_name='inference.ModelSequenceBatching.ControlInput.control', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5065, serialized_end=5152, ) _MODELSEQUENCEBATCHING_INITIALSTATE = _descriptor.Descriptor( name='InitialState', full_name='inference.ModelSequenceBatching.InitialState', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelSequenceBatching.InitialState.data_type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dims', full_name='inference.ModelSequenceBatching.InitialState.dims', index=1, number=2, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='zero_data', full_name='inference.ModelSequenceBatching.InitialState.zero_data', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_file', full_name='inference.ModelSequenceBatching.InitialState.data_file', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='inference.ModelSequenceBatching.InitialState.name', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='state_data', full_name='inference.ModelSequenceBatching.InitialState.state_data', index=0, containing_type=None, fields=[]), ], serialized_start=5155, serialized_end=5293, ) _MODELSEQUENCEBATCHING_STATE = _descriptor.Descriptor( name='State', full_name='inference.ModelSequenceBatching.State', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='input_name', full_name='inference.ModelSequenceBatching.State.input_name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='output_name', full_name='inference.ModelSequenceBatching.State.output_name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelSequenceBatching.State.data_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dims', full_name='inference.ModelSequenceBatching.State.dims', index=3, number=4, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='initial_state', full_name='inference.ModelSequenceBatching.State.initial_state', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5296, serialized_end=5468, ) _MODELSEQUENCEBATCHING_STRATEGYDIRECT = _descriptor.Descriptor( name='StrategyDirect', full_name='inference.ModelSequenceBatching.StrategyDirect', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='max_queue_delay_microseconds', full_name='inference.ModelSequenceBatching.StrategyDirect.max_queue_delay_microseconds', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='minimum_slot_utilization', full_name='inference.ModelSequenceBatching.StrategyDirect.minimum_slot_utilization', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5470, serialized_end=5558, ) _MODELSEQUENCEBATCHING_STRATEGYOLDEST = _descriptor.Descriptor( name='StrategyOldest', full_name='inference.ModelSequenceBatching.StrategyOldest', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='max_candidate_sequences', full_name='inference.ModelSequenceBatching.StrategyOldest.max_candidate_sequences', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='preferred_batch_size', full_name='inference.ModelSequenceBatching.StrategyOldest.preferred_batch_size', index=1, number=2, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_queue_delay_microseconds', full_name='inference.ModelSequenceBatching.StrategyOldest.max_queue_delay_microseconds', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5560, serialized_end=5677, ) _MODELSEQUENCEBATCHING = _descriptor.Descriptor( name='ModelSequenceBatching', full_name='inference.ModelSequenceBatching', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='direct', full_name='inference.ModelSequenceBatching.direct', index=0, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='oldest', full_name='inference.ModelSequenceBatching.oldest', index=1, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_sequence_idle_microseconds', full_name='inference.ModelSequenceBatching.max_sequence_idle_microseconds', index=2, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='control_input', full_name='inference.ModelSequenceBatching.control_input', index=3, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='state', full_name='inference.ModelSequenceBatching.state', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELSEQUENCEBATCHING_CONTROL, _MODELSEQUENCEBATCHING_CONTROLINPUT, _MODELSEQUENCEBATCHING_INITIALSTATE, _MODELSEQUENCEBATCHING_STATE, _MODELSEQUENCEBATCHING_STRATEGYDIRECT, _MODELSEQUENCEBATCHING_STRATEGYOLDEST, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='strategy_choice', full_name='inference.ModelSequenceBatching.strategy_choice', index=0, containing_type=None, fields=[]), ], serialized_start=4433, serialized_end=5696, ) _MODELENSEMBLING_STEP_INPUTMAPENTRY = _descriptor.Descriptor( name='InputMapEntry', full_name='inference.ModelEnsembling.Step.InputMapEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelEnsembling.Step.InputMapEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelEnsembling.Step.InputMapEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5951, serialized_end=5998, ) _MODELENSEMBLING_STEP_OUTPUTMAPENTRY = _descriptor.Descriptor( name='OutputMapEntry', full_name='inference.ModelEnsembling.Step.OutputMapEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelEnsembling.Step.OutputMapEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelEnsembling.Step.OutputMapEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6000, serialized_end=6048, ) _MODELENSEMBLING_STEP = _descriptor.Descriptor( name='Step', full_name='inference.ModelEnsembling.Step', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='model_name', full_name='inference.ModelEnsembling.Step.model_name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model_version', full_name='inference.ModelEnsembling.Step.model_version', index=1, number=2, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input_map', full_name='inference.ModelEnsembling.Step.input_map', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='output_map', full_name='inference.ModelEnsembling.Step.output_map', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELENSEMBLING_STEP_INPUTMAPENTRY, _MODELENSEMBLING_STEP_OUTPUTMAPENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5766, serialized_end=6048, ) _MODELENSEMBLING = _descriptor.Descriptor( name='ModelEnsembling', full_name='inference.ModelEnsembling', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='step', full_name='inference.ModelEnsembling.step', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELENSEMBLING_STEP, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=5699, serialized_end=6048, ) _MODELPARAMETER = _descriptor.Descriptor( name='ModelParameter', full_name='inference.ModelParameter', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='string_value', full_name='inference.ModelParameter.string_value', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6050, serialized_end=6088, ) _MODELWARMUP_INPUT = _descriptor.Descriptor( name='Input', full_name='inference.ModelWarmup.Input', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data_type', full_name='inference.ModelWarmup.Input.data_type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dims', full_name='inference.ModelWarmup.Input.dims', index=1, number=2, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='zero_data', full_name='inference.ModelWarmup.Input.zero_data', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='random_data', full_name='inference.ModelWarmup.Input.random_data', index=3, number=4, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input_data_file', full_name='inference.ModelWarmup.Input.input_data_file', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='input_data_type', full_name='inference.ModelWarmup.Input.input_data_type', index=0, containing_type=None, fields=[]), ], serialized_start=6208, serialized_end=6359, ) _MODELWARMUP_INPUTSENTRY = _descriptor.Descriptor( name='InputsEntry', full_name='inference.ModelWarmup.InputsEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelWarmup.InputsEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelWarmup.InputsEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6361, serialized_end=6436, ) _MODELWARMUP = _descriptor.Descriptor( name='ModelWarmup', full_name='inference.ModelWarmup', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelWarmup.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='batch_size', full_name='inference.ModelWarmup.batch_size', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='inputs', full_name='inference.ModelWarmup.inputs', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='count', full_name='inference.ModelWarmup.count', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELWARMUP_INPUT, _MODELWARMUP_INPUTSENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6091, serialized_end=6436, ) _MODELOPERATIONS = _descriptor.Descriptor( name='ModelOperations', full_name='inference.ModelOperations', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='op_library_filename', full_name='inference.ModelOperations.op_library_filename', index=0, number=1, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6438, serialized_end=6484, ) _MODELTRANSACTIONPOLICY = _descriptor.Descriptor( name='ModelTransactionPolicy', full_name='inference.ModelTransactionPolicy', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='decoupled', full_name='inference.ModelTransactionPolicy.decoupled', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6486, serialized_end=6529, ) _MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY = _descriptor.Descriptor( name='ParametersEntry', full_name='inference.ModelRepositoryAgents.Agent.ParametersEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelRepositoryAgents.Agent.ParametersEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelRepositoryAgents.Agent.ParametersEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3632, serialized_end=3681, ) _MODELREPOSITORYAGENTS_AGENT = _descriptor.Descriptor( name='Agent', full_name='inference.ModelRepositoryAgents.Agent', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelRepositoryAgents.Agent.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='parameters', full_name='inference.ModelRepositoryAgents.Agent.parameters', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6614, serialized_end=6762, ) _MODELREPOSITORYAGENTS = _descriptor.Descriptor( name='ModelRepositoryAgents', full_name='inference.ModelRepositoryAgents', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='agents', full_name='inference.ModelRepositoryAgents.agents', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELREPOSITORYAGENTS_AGENT, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6532, serialized_end=6762, ) _MODELRESPONSECACHE = _descriptor.Descriptor( name='ModelResponseCache', full_name='inference.ModelResponseCache', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='enable', full_name='inference.ModelResponseCache.enable', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=6764, serialized_end=6800, ) _MODELCONFIG_CCMODELFILENAMESENTRY = _descriptor.Descriptor( name='CcModelFilenamesEntry', full_name='inference.ModelConfig.CcModelFilenamesEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelConfig.CcModelFilenamesEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelConfig.CcModelFilenamesEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=7928, serialized_end=7983, ) _MODELCONFIG_METRICTAGSENTRY = _descriptor.Descriptor( name='MetricTagsEntry', full_name='inference.ModelConfig.MetricTagsEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelConfig.MetricTagsEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelConfig.MetricTagsEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=7985, serialized_end=8034, ) _MODELCONFIG_PARAMETERSENTRY = _descriptor.Descriptor( name='ParametersEntry', full_name='inference.ModelConfig.ParametersEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='inference.ModelConfig.ParametersEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='inference.ModelConfig.ParametersEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=8036, serialized_end=8112, ) _MODELCONFIG = _descriptor.Descriptor( name='ModelConfig', full_name='inference.ModelConfig', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='inference.ModelConfig.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='platform', full_name='inference.ModelConfig.platform', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='backend', full_name='inference.ModelConfig.backend', index=2, number=17, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='version_policy', full_name='inference.ModelConfig.version_policy', index=3, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_batch_size', full_name='inference.ModelConfig.max_batch_size', index=4, number=4, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='input', full_name='inference.ModelConfig.input', index=5, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='output', full_name='inference.ModelConfig.output', index=6, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='batch_input', full_name='inference.ModelConfig.batch_input', index=7, number=20, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='batch_output', full_name='inference.ModelConfig.batch_output', index=8, number=21, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='optimization', full_name='inference.ModelConfig.optimization', index=9, number=12, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dynamic_batching', full_name='inference.ModelConfig.dynamic_batching', index=10, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sequence_batching', full_name='inference.ModelConfig.sequence_batching', index=11, number=13, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ensemble_scheduling', full_name='inference.ModelConfig.ensemble_scheduling', index=12, number=15, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='instance_group', full_name='inference.ModelConfig.instance_group', index=13, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_model_filename', full_name='inference.ModelConfig.default_model_filename', index=14, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cc_model_filenames', full_name='inference.ModelConfig.cc_model_filenames', index=15, number=9, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='metric_tags', full_name='inference.ModelConfig.metric_tags', index=16, number=10, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='parameters', full_name='inference.ModelConfig.parameters', index=17, number=14, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model_warmup', full_name='inference.ModelConfig.model_warmup', index=18, number=16, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model_operations', full_name='inference.ModelConfig.model_operations', index=19, number=18, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model_transaction_policy', full_name='inference.ModelConfig.model_transaction_policy', index=20, number=19, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model_repository_agents', full_name='inference.ModelConfig.model_repository_agents', index=21, number=23, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='response_cache', full_name='inference.ModelConfig.response_cache', index=22, number=24, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_MODELCONFIG_CCMODELFILENAMESENTRY, _MODELCONFIG_METRICTAGSENTRY, _MODELCONFIG_PARAMETERSENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='scheduling_choice', full_name='inference.ModelConfig.scheduling_choice', index=0, containing_type=None, fields=[]), ], serialized_start=6803, serialized_end=8133, ) _MODELRATELIMITER_RESOURCE.containing_type = _MODELRATELIMITER _MODELRATELIMITER.fields_by_name['resources'].message_type = _MODELRATELIMITER_RESOURCE _MODELINSTANCEGROUP_SECONDARYDEVICE.fields_by_name['kind'].enum_type = _MODELINSTANCEGROUP_SECONDARYDEVICE_SECONDARYDEVICEKIND _MODELINSTANCEGROUP_SECONDARYDEVICE.containing_type = _MODELINSTANCEGROUP _MODELINSTANCEGROUP_SECONDARYDEVICE_SECONDARYDEVICEKIND.containing_type = _MODELINSTANCEGROUP_SECONDARYDEVICE _MODELINSTANCEGROUP.fields_by_name['kind'].enum_type = _MODELINSTANCEGROUP_KIND _MODELINSTANCEGROUP.fields_by_name['rate_limiter'].message_type = _MODELRATELIMITER _MODELINSTANCEGROUP.fields_by_name['secondary_devices'].message_type = _MODELINSTANCEGROUP_SECONDARYDEVICE _MODELINSTANCEGROUP_KIND.containing_type = _MODELINSTANCEGROUP _MODELINPUT.fields_by_name['data_type'].enum_type = _DATATYPE _MODELINPUT.fields_by_name['format'].enum_type = _MODELINPUT_FORMAT _MODELINPUT.fields_by_name['reshape'].message_type = _MODELTENSORRESHAPE _MODELINPUT_FORMAT.containing_type = _MODELINPUT _MODELOUTPUT.fields_by_name['data_type'].enum_type = _DATATYPE _MODELOUTPUT.fields_by_name['reshape'].message_type = _MODELTENSORRESHAPE _BATCHINPUT.fields_by_name['kind'].enum_type = _BATCHINPUT_KIND _BATCHINPUT.fields_by_name['data_type'].enum_type = _DATATYPE _BATCHINPUT_KIND.containing_type = _BATCHINPUT _BATCHOUTPUT.fields_by_name['kind'].enum_type = _BATCHOUTPUT_KIND _BATCHOUTPUT_KIND.containing_type = _BATCHOUTPUT _MODELVERSIONPOLICY_LATEST.containing_type = _MODELVERSIONPOLICY _MODELVERSIONPOLICY_ALL.containing_type = _MODELVERSIONPOLICY _MODELVERSIONPOLICY_SPECIFIC.containing_type = _MODELVERSIONPOLICY _MODELVERSIONPOLICY.fields_by_name['latest'].message_type = _MODELVERSIONPOLICY_LATEST _MODELVERSIONPOLICY.fields_by_name['all'].message_type = _MODELVERSIONPOLICY_ALL _MODELVERSIONPOLICY.fields_by_name['specific'].message_type = _MODELVERSIONPOLICY_SPECIFIC _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'].fields.append( _MODELVERSIONPOLICY.fields_by_name['latest']) _MODELVERSIONPOLICY.fields_by_name['latest'].containing_oneof = _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'] _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'].fields.append( _MODELVERSIONPOLICY.fields_by_name['all']) _MODELVERSIONPOLICY.fields_by_name['all'].containing_oneof = _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'] _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'].fields.append( _MODELVERSIONPOLICY.fields_by_name['specific']) _MODELVERSIONPOLICY.fields_by_name['specific'].containing_oneof = _MODELVERSIONPOLICY.oneofs_by_name['policy_choice'] _MODELOPTIMIZATIONPOLICY_GRAPH.containing_type = _MODELOPTIMIZATIONPOLICY _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE.containing_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY.fields_by_name['value'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY.containing_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND.fields_by_name['input'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND.containing_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY.fields_by_name['value'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY.containing_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC.fields_by_name['input'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC.fields_by_name['graph_lower_bound'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC.containing_type = _MODELOPTIMIZATIONPOLICY_CUDA _MODELOPTIMIZATIONPOLICY_CUDA.fields_by_name['graph_spec'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC _MODELOPTIMIZATIONPOLICY_CUDA.containing_type = _MODELOPTIMIZATIONPOLICY _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY.containing_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR.fields_by_name['parameters'].message_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR.containing_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS.fields_by_name['gpu_execution_accelerator'].message_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS.fields_by_name['cpu_execution_accelerator'].message_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS.containing_type = _MODELOPTIMIZATIONPOLICY _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER.containing_type = _MODELOPTIMIZATIONPOLICY _MODELOPTIMIZATIONPOLICY.fields_by_name['graph'].message_type = _MODELOPTIMIZATIONPOLICY_GRAPH _MODELOPTIMIZATIONPOLICY.fields_by_name['priority'].enum_type = _MODELOPTIMIZATIONPOLICY_MODELPRIORITY _MODELOPTIMIZATIONPOLICY.fields_by_name['cuda'].message_type = _MODELOPTIMIZATIONPOLICY_CUDA _MODELOPTIMIZATIONPOLICY.fields_by_name['execution_accelerators'].message_type = _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS _MODELOPTIMIZATIONPOLICY.fields_by_name['input_pinned_memory'].message_type = _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER _MODELOPTIMIZATIONPOLICY.fields_by_name['output_pinned_memory'].message_type = _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER _MODELOPTIMIZATIONPOLICY_MODELPRIORITY.containing_type = _MODELOPTIMIZATIONPOLICY _MODELQUEUEPOLICY.fields_by_name['timeout_action'].enum_type = _MODELQUEUEPOLICY_TIMEOUTACTION _MODELQUEUEPOLICY_TIMEOUTACTION.containing_type = _MODELQUEUEPOLICY _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY.fields_by_name['value'].message_type = _MODELQUEUEPOLICY _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY.containing_type = _MODELDYNAMICBATCHING _MODELDYNAMICBATCHING.fields_by_name['default_queue_policy'].message_type = _MODELQUEUEPOLICY _MODELDYNAMICBATCHING.fields_by_name['priority_queue_policy'].message_type = _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY _MODELSEQUENCEBATCHING_CONTROL.fields_by_name['kind'].enum_type = _MODELSEQUENCEBATCHING_CONTROL_KIND _MODELSEQUENCEBATCHING_CONTROL.fields_by_name['data_type'].enum_type = _DATATYPE _MODELSEQUENCEBATCHING_CONTROL.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING_CONTROL_KIND.containing_type = _MODELSEQUENCEBATCHING_CONTROL _MODELSEQUENCEBATCHING_CONTROLINPUT.fields_by_name['control'].message_type = _MODELSEQUENCEBATCHING_CONTROL _MODELSEQUENCEBATCHING_CONTROLINPUT.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING_INITIALSTATE.fields_by_name['data_type'].enum_type = _DATATYPE _MODELSEQUENCEBATCHING_INITIALSTATE.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING_INITIALSTATE.oneofs_by_name['state_data'].fields.append( _MODELSEQUENCEBATCHING_INITIALSTATE.fields_by_name['zero_data']) _MODELSEQUENCEBATCHING_INITIALSTATE.fields_by_name['zero_data'].containing_oneof = _MODELSEQUENCEBATCHING_INITIALSTATE.oneofs_by_name['state_data'] _MODELSEQUENCEBATCHING_INITIALSTATE.oneofs_by_name['state_data'].fields.append( _MODELSEQUENCEBATCHING_INITIALSTATE.fields_by_name['data_file']) _MODELSEQUENCEBATCHING_INITIALSTATE.fields_by_name['data_file'].containing_oneof = _MODELSEQUENCEBATCHING_INITIALSTATE.oneofs_by_name['state_data'] _MODELSEQUENCEBATCHING_STATE.fields_by_name['data_type'].enum_type = _DATATYPE _MODELSEQUENCEBATCHING_STATE.fields_by_name['initial_state'].message_type = _MODELSEQUENCEBATCHING_INITIALSTATE _MODELSEQUENCEBATCHING_STATE.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING_STRATEGYDIRECT.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING_STRATEGYOLDEST.containing_type = _MODELSEQUENCEBATCHING _MODELSEQUENCEBATCHING.fields_by_name['direct'].message_type = _MODELSEQUENCEBATCHING_STRATEGYDIRECT _MODELSEQUENCEBATCHING.fields_by_name['oldest'].message_type = _MODELSEQUENCEBATCHING_STRATEGYOLDEST _MODELSEQUENCEBATCHING.fields_by_name['control_input'].message_type = _MODELSEQUENCEBATCHING_CONTROLINPUT _MODELSEQUENCEBATCHING.fields_by_name['state'].message_type = _MODELSEQUENCEBATCHING_STATE _MODELSEQUENCEBATCHING.oneofs_by_name['strategy_choice'].fields.append( _MODELSEQUENCEBATCHING.fields_by_name['direct']) _MODELSEQUENCEBATCHING.fields_by_name['direct'].containing_oneof = _MODELSEQUENCEBATCHING.oneofs_by_name['strategy_choice'] _MODELSEQUENCEBATCHING.oneofs_by_name['strategy_choice'].fields.append( _MODELSEQUENCEBATCHING.fields_by_name['oldest']) _MODELSEQUENCEBATCHING.fields_by_name['oldest'].containing_oneof = _MODELSEQUENCEBATCHING.oneofs_by_name['strategy_choice'] _MODELENSEMBLING_STEP_INPUTMAPENTRY.containing_type = _MODELENSEMBLING_STEP _MODELENSEMBLING_STEP_OUTPUTMAPENTRY.containing_type = _MODELENSEMBLING_STEP _MODELENSEMBLING_STEP.fields_by_name['input_map'].message_type = _MODELENSEMBLING_STEP_INPUTMAPENTRY _MODELENSEMBLING_STEP.fields_by_name['output_map'].message_type = _MODELENSEMBLING_STEP_OUTPUTMAPENTRY _MODELENSEMBLING_STEP.containing_type = _MODELENSEMBLING _MODELENSEMBLING.fields_by_name['step'].message_type = _MODELENSEMBLING_STEP _MODELWARMUP_INPUT.fields_by_name['data_type'].enum_type = _DATATYPE _MODELWARMUP_INPUT.containing_type = _MODELWARMUP _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'].fields.append( _MODELWARMUP_INPUT.fields_by_name['zero_data']) _MODELWARMUP_INPUT.fields_by_name['zero_data'].containing_oneof = _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'] _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'].fields.append( _MODELWARMUP_INPUT.fields_by_name['random_data']) _MODELWARMUP_INPUT.fields_by_name['random_data'].containing_oneof = _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'] _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'].fields.append( _MODELWARMUP_INPUT.fields_by_name['input_data_file']) _MODELWARMUP_INPUT.fields_by_name['input_data_file'].containing_oneof = _MODELWARMUP_INPUT.oneofs_by_name['input_data_type'] _MODELWARMUP_INPUTSENTRY.fields_by_name['value'].message_type = _MODELWARMUP_INPUT _MODELWARMUP_INPUTSENTRY.containing_type = _MODELWARMUP _MODELWARMUP.fields_by_name['inputs'].message_type = _MODELWARMUP_INPUTSENTRY _MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY.containing_type = _MODELREPOSITORYAGENTS_AGENT _MODELREPOSITORYAGENTS_AGENT.fields_by_name['parameters'].message_type = _MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY _MODELREPOSITORYAGENTS_AGENT.containing_type = _MODELREPOSITORYAGENTS _MODELREPOSITORYAGENTS.fields_by_name['agents'].message_type = _MODELREPOSITORYAGENTS_AGENT _MODELCONFIG_CCMODELFILENAMESENTRY.containing_type = _MODELCONFIG _MODELCONFIG_METRICTAGSENTRY.containing_type = _MODELCONFIG _MODELCONFIG_PARAMETERSENTRY.fields_by_name['value'].message_type = _MODELPARAMETER _MODELCONFIG_PARAMETERSENTRY.containing_type = _MODELCONFIG _MODELCONFIG.fields_by_name['version_policy'].message_type = _MODELVERSIONPOLICY _MODELCONFIG.fields_by_name['input'].message_type = _MODELINPUT _MODELCONFIG.fields_by_name['output'].message_type = _MODELOUTPUT _MODELCONFIG.fields_by_name['batch_input'].message_type = _BATCHINPUT _MODELCONFIG.fields_by_name['batch_output'].message_type = _BATCHOUTPUT _MODELCONFIG.fields_by_name['optimization'].message_type = _MODELOPTIMIZATIONPOLICY _MODELCONFIG.fields_by_name['dynamic_batching'].message_type = _MODELDYNAMICBATCHING _MODELCONFIG.fields_by_name['sequence_batching'].message_type = _MODELSEQUENCEBATCHING _MODELCONFIG.fields_by_name['ensemble_scheduling'].message_type = _MODELENSEMBLING _MODELCONFIG.fields_by_name['instance_group'].message_type = _MODELINSTANCEGROUP _MODELCONFIG.fields_by_name['cc_model_filenames'].message_type = _MODELCONFIG_CCMODELFILENAMESENTRY _MODELCONFIG.fields_by_name['metric_tags'].message_type = _MODELCONFIG_METRICTAGSENTRY _MODELCONFIG.fields_by_name['parameters'].message_type = _MODELCONFIG_PARAMETERSENTRY _MODELCONFIG.fields_by_name['model_warmup'].message_type = _MODELWARMUP _MODELCONFIG.fields_by_name['model_operations'].message_type = _MODELOPERATIONS _MODELCONFIG.fields_by_name['model_transaction_policy'].message_type = _MODELTRANSACTIONPOLICY _MODELCONFIG.fields_by_name['model_repository_agents'].message_type = _MODELREPOSITORYAGENTS _MODELCONFIG.fields_by_name['response_cache'].message_type = _MODELRESPONSECACHE _MODELCONFIG.oneofs_by_name['scheduling_choice'].fields.append( _MODELCONFIG.fields_by_name['dynamic_batching']) _MODELCONFIG.fields_by_name['dynamic_batching'].containing_oneof = _MODELCONFIG.oneofs_by_name['scheduling_choice'] _MODELCONFIG.oneofs_by_name['scheduling_choice'].fields.append( _MODELCONFIG.fields_by_name['sequence_batching']) _MODELCONFIG.fields_by_name['sequence_batching'].containing_oneof = _MODELCONFIG.oneofs_by_name['scheduling_choice'] _MODELCONFIG.oneofs_by_name['scheduling_choice'].fields.append( _MODELCONFIG.fields_by_name['ensemble_scheduling']) _MODELCONFIG.fields_by_name['ensemble_scheduling'].containing_oneof = _MODELCONFIG.oneofs_by_name['scheduling_choice'] DESCRIPTOR.message_types_by_name['ModelRateLimiter'] = _MODELRATELIMITER DESCRIPTOR.message_types_by_name['ModelInstanceGroup'] = _MODELINSTANCEGROUP DESCRIPTOR.message_types_by_name['ModelTensorReshape'] = _MODELTENSORRESHAPE DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT DESCRIPTOR.message_types_by_name['BatchInput'] = _BATCHINPUT DESCRIPTOR.message_types_by_name['BatchOutput'] = _BATCHOUTPUT DESCRIPTOR.message_types_by_name['ModelVersionPolicy'] = _MODELVERSIONPOLICY DESCRIPTOR.message_types_by_name['ModelOptimizationPolicy'] = _MODELOPTIMIZATIONPOLICY DESCRIPTOR.message_types_by_name['ModelQueuePolicy'] = _MODELQUEUEPOLICY DESCRIPTOR.message_types_by_name['ModelDynamicBatching'] = _MODELDYNAMICBATCHING DESCRIPTOR.message_types_by_name['ModelSequenceBatching'] = _MODELSEQUENCEBATCHING DESCRIPTOR.message_types_by_name['ModelEnsembling'] = _MODELENSEMBLING DESCRIPTOR.message_types_by_name['ModelParameter'] = _MODELPARAMETER DESCRIPTOR.message_types_by_name['ModelWarmup'] = _MODELWARMUP DESCRIPTOR.message_types_by_name['ModelOperations'] = _MODELOPERATIONS DESCRIPTOR.message_types_by_name['ModelTransactionPolicy'] = _MODELTRANSACTIONPOLICY DESCRIPTOR.message_types_by_name['ModelRepositoryAgents'] = _MODELREPOSITORYAGENTS DESCRIPTOR.message_types_by_name['ModelResponseCache'] = _MODELRESPONSECACHE DESCRIPTOR.message_types_by_name['ModelConfig'] = _MODELCONFIG DESCRIPTOR.enum_types_by_name['DataType'] = _DATATYPE _sym_db.RegisterFileDescriptor(DESCRIPTOR) ModelRateLimiter = _reflection.GeneratedProtocolMessageType('ModelRateLimiter', (_message.Message,), { 'Resource' : _reflection.GeneratedProtocolMessageType('Resource', (_message.Message,), { 'DESCRIPTOR' : _MODELRATELIMITER_RESOURCE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelRateLimiter.Resource) }) , 'DESCRIPTOR' : _MODELRATELIMITER, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelRateLimiter) }) _sym_db.RegisterMessage(ModelRateLimiter) _sym_db.RegisterMessage(ModelRateLimiter.Resource) ModelInstanceGroup = _reflection.GeneratedProtocolMessageType('ModelInstanceGroup', (_message.Message,), { 'SecondaryDevice' : _reflection.GeneratedProtocolMessageType('SecondaryDevice', (_message.Message,), { 'DESCRIPTOR' : _MODELINSTANCEGROUP_SECONDARYDEVICE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelInstanceGroup.SecondaryDevice) }) , 'DESCRIPTOR' : _MODELINSTANCEGROUP, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelInstanceGroup) }) _sym_db.RegisterMessage(ModelInstanceGroup) _sym_db.RegisterMessage(ModelInstanceGroup.SecondaryDevice) ModelTensorReshape = _reflection.GeneratedProtocolMessageType('ModelTensorReshape', (_message.Message,), { 'DESCRIPTOR' : _MODELTENSORRESHAPE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelTensorReshape) }) _sym_db.RegisterMessage(ModelTensorReshape) ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { 'DESCRIPTOR' : _MODELINPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelInput) }) _sym_db.RegisterMessage(ModelInput) ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { 'DESCRIPTOR' : _MODELOUTPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOutput) }) _sym_db.RegisterMessage(ModelOutput) BatchInput = _reflection.GeneratedProtocolMessageType('BatchInput', (_message.Message,), { 'DESCRIPTOR' : _BATCHINPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.BatchInput) }) _sym_db.RegisterMessage(BatchInput) BatchOutput = _reflection.GeneratedProtocolMessageType('BatchOutput', (_message.Message,), { 'DESCRIPTOR' : _BATCHOUTPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.BatchOutput) }) _sym_db.RegisterMessage(BatchOutput) ModelVersionPolicy = _reflection.GeneratedProtocolMessageType('ModelVersionPolicy', (_message.Message,), { 'Latest' : _reflection.GeneratedProtocolMessageType('Latest', (_message.Message,), { 'DESCRIPTOR' : _MODELVERSIONPOLICY_LATEST, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelVersionPolicy.Latest) }) , 'All' : _reflection.GeneratedProtocolMessageType('All', (_message.Message,), { 'DESCRIPTOR' : _MODELVERSIONPOLICY_ALL, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelVersionPolicy.All) }) , 'Specific' : _reflection.GeneratedProtocolMessageType('Specific', (_message.Message,), { 'DESCRIPTOR' : _MODELVERSIONPOLICY_SPECIFIC, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelVersionPolicy.Specific) }) , 'DESCRIPTOR' : _MODELVERSIONPOLICY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelVersionPolicy) }) _sym_db.RegisterMessage(ModelVersionPolicy) _sym_db.RegisterMessage(ModelVersionPolicy.Latest) _sym_db.RegisterMessage(ModelVersionPolicy.All) _sym_db.RegisterMessage(ModelVersionPolicy.Specific) ModelOptimizationPolicy = _reflection.GeneratedProtocolMessageType('ModelOptimizationPolicy', (_message.Message,), { 'Graph' : _reflection.GeneratedProtocolMessageType('Graph', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_GRAPH, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Graph) }) , 'Cuda' : _reflection.GeneratedProtocolMessageType('Cuda', (_message.Message,), { 'GraphSpec' : _reflection.GeneratedProtocolMessageType('GraphSpec', (_message.Message,), { 'Shape' : _reflection.GeneratedProtocolMessageType('Shape', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_SHAPE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda.GraphSpec.Shape) }) , 'LowerBound' : _reflection.GeneratedProtocolMessageType('LowerBound', (_message.Message,), { 'InputEntry' : _reflection.GeneratedProtocolMessageType('InputEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound) }) , 'InputEntry' : _reflection.GeneratedProtocolMessageType('InputEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda.GraphSpec) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_CUDA, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.Cuda) }) , 'ExecutionAccelerators' : _reflection.GeneratedProtocolMessageType('ExecutionAccelerators', (_message.Message,), { 'Accelerator' : _reflection.GeneratedProtocolMessageType('Accelerator', (_message.Message,), { 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.ExecutionAccelerators.Accelerator) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.ExecutionAccelerators) }) , 'PinnedMemoryBuffer' : _reflection.GeneratedProtocolMessageType('PinnedMemoryBuffer', (_message.Message,), { 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY_PINNEDMEMORYBUFFER, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy.PinnedMemoryBuffer) }) , 'DESCRIPTOR' : _MODELOPTIMIZATIONPOLICY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOptimizationPolicy) }) _sym_db.RegisterMessage(ModelOptimizationPolicy) _sym_db.RegisterMessage(ModelOptimizationPolicy.Graph) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda.GraphSpec) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda.GraphSpec.Shape) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda.GraphSpec.LowerBound.InputEntry) _sym_db.RegisterMessage(ModelOptimizationPolicy.Cuda.GraphSpec.InputEntry) _sym_db.RegisterMessage(ModelOptimizationPolicy.ExecutionAccelerators) _sym_db.RegisterMessage(ModelOptimizationPolicy.ExecutionAccelerators.Accelerator) _sym_db.RegisterMessage(ModelOptimizationPolicy.ExecutionAccelerators.Accelerator.ParametersEntry) _sym_db.RegisterMessage(ModelOptimizationPolicy.PinnedMemoryBuffer) ModelQueuePolicy = _reflection.GeneratedProtocolMessageType('ModelQueuePolicy', (_message.Message,), { 'DESCRIPTOR' : _MODELQUEUEPOLICY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelQueuePolicy) }) _sym_db.RegisterMessage(ModelQueuePolicy) ModelDynamicBatching = _reflection.GeneratedProtocolMessageType('ModelDynamicBatching', (_message.Message,), { 'PriorityQueuePolicyEntry' : _reflection.GeneratedProtocolMessageType('PriorityQueuePolicyEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelDynamicBatching.PriorityQueuePolicyEntry) }) , 'DESCRIPTOR' : _MODELDYNAMICBATCHING, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelDynamicBatching) }) _sym_db.RegisterMessage(ModelDynamicBatching) _sym_db.RegisterMessage(ModelDynamicBatching.PriorityQueuePolicyEntry) ModelSequenceBatching = _reflection.GeneratedProtocolMessageType('ModelSequenceBatching', (_message.Message,), { 'Control' : _reflection.GeneratedProtocolMessageType('Control', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_CONTROL, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.Control) }) , 'ControlInput' : _reflection.GeneratedProtocolMessageType('ControlInput', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_CONTROLINPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.ControlInput) }) , 'InitialState' : _reflection.GeneratedProtocolMessageType('InitialState', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_INITIALSTATE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.InitialState) }) , 'State' : _reflection.GeneratedProtocolMessageType('State', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_STATE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.State) }) , 'StrategyDirect' : _reflection.GeneratedProtocolMessageType('StrategyDirect', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_STRATEGYDIRECT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.StrategyDirect) }) , 'StrategyOldest' : _reflection.GeneratedProtocolMessageType('StrategyOldest', (_message.Message,), { 'DESCRIPTOR' : _MODELSEQUENCEBATCHING_STRATEGYOLDEST, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching.StrategyOldest) }) , 'DESCRIPTOR' : _MODELSEQUENCEBATCHING, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelSequenceBatching) }) _sym_db.RegisterMessage(ModelSequenceBatching) _sym_db.RegisterMessage(ModelSequenceBatching.Control) _sym_db.RegisterMessage(ModelSequenceBatching.ControlInput) _sym_db.RegisterMessage(ModelSequenceBatching.InitialState) _sym_db.RegisterMessage(ModelSequenceBatching.State) _sym_db.RegisterMessage(ModelSequenceBatching.StrategyDirect) _sym_db.RegisterMessage(ModelSequenceBatching.StrategyOldest) ModelEnsembling = _reflection.GeneratedProtocolMessageType('ModelEnsembling', (_message.Message,), { 'Step' : _reflection.GeneratedProtocolMessageType('Step', (_message.Message,), { 'InputMapEntry' : _reflection.GeneratedProtocolMessageType('InputMapEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELENSEMBLING_STEP_INPUTMAPENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelEnsembling.Step.InputMapEntry) }) , 'OutputMapEntry' : _reflection.GeneratedProtocolMessageType('OutputMapEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELENSEMBLING_STEP_OUTPUTMAPENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelEnsembling.Step.OutputMapEntry) }) , 'DESCRIPTOR' : _MODELENSEMBLING_STEP, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelEnsembling.Step) }) , 'DESCRIPTOR' : _MODELENSEMBLING, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelEnsembling) }) _sym_db.RegisterMessage(ModelEnsembling) _sym_db.RegisterMessage(ModelEnsembling.Step) _sym_db.RegisterMessage(ModelEnsembling.Step.InputMapEntry) _sym_db.RegisterMessage(ModelEnsembling.Step.OutputMapEntry) ModelParameter = _reflection.GeneratedProtocolMessageType('ModelParameter', (_message.Message,), { 'DESCRIPTOR' : _MODELPARAMETER, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelParameter) }) _sym_db.RegisterMessage(ModelParameter) ModelWarmup = _reflection.GeneratedProtocolMessageType('ModelWarmup', (_message.Message,), { 'Input' : _reflection.GeneratedProtocolMessageType('Input', (_message.Message,), { 'DESCRIPTOR' : _MODELWARMUP_INPUT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelWarmup.Input) }) , 'InputsEntry' : _reflection.GeneratedProtocolMessageType('InputsEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELWARMUP_INPUTSENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelWarmup.InputsEntry) }) , 'DESCRIPTOR' : _MODELWARMUP, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelWarmup) }) _sym_db.RegisterMessage(ModelWarmup) _sym_db.RegisterMessage(ModelWarmup.Input) _sym_db.RegisterMessage(ModelWarmup.InputsEntry) ModelOperations = _reflection.GeneratedProtocolMessageType('ModelOperations', (_message.Message,), { 'DESCRIPTOR' : _MODELOPERATIONS, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelOperations) }) _sym_db.RegisterMessage(ModelOperations) ModelTransactionPolicy = _reflection.GeneratedProtocolMessageType('ModelTransactionPolicy', (_message.Message,), { 'DESCRIPTOR' : _MODELTRANSACTIONPOLICY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelTransactionPolicy) }) _sym_db.RegisterMessage(ModelTransactionPolicy) ModelRepositoryAgents = _reflection.GeneratedProtocolMessageType('ModelRepositoryAgents', (_message.Message,), { 'Agent' : _reflection.GeneratedProtocolMessageType('Agent', (_message.Message,), { 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelRepositoryAgents.Agent.ParametersEntry) }) , 'DESCRIPTOR' : _MODELREPOSITORYAGENTS_AGENT, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelRepositoryAgents.Agent) }) , 'DESCRIPTOR' : _MODELREPOSITORYAGENTS, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelRepositoryAgents) }) _sym_db.RegisterMessage(ModelRepositoryAgents) _sym_db.RegisterMessage(ModelRepositoryAgents.Agent) _sym_db.RegisterMessage(ModelRepositoryAgents.Agent.ParametersEntry) ModelResponseCache = _reflection.GeneratedProtocolMessageType('ModelResponseCache', (_message.Message,), { 'DESCRIPTOR' : _MODELRESPONSECACHE, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelResponseCache) }) _sym_db.RegisterMessage(ModelResponseCache) ModelConfig = _reflection.GeneratedProtocolMessageType('ModelConfig', (_message.Message,), { 'CcModelFilenamesEntry' : _reflection.GeneratedProtocolMessageType('CcModelFilenamesEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELCONFIG_CCMODELFILENAMESENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelConfig.CcModelFilenamesEntry) }) , 'MetricTagsEntry' : _reflection.GeneratedProtocolMessageType('MetricTagsEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELCONFIG_METRICTAGSENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelConfig.MetricTagsEntry) }) , 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { 'DESCRIPTOR' : _MODELCONFIG_PARAMETERSENTRY, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelConfig.ParametersEntry) }) , 'DESCRIPTOR' : _MODELCONFIG, '__module__' : 'model_config_pb2' # @@protoc_insertion_point(class_scope:inference.ModelConfig) }) _sym_db.RegisterMessage(ModelConfig) _sym_db.RegisterMessage(ModelConfig.CcModelFilenamesEntry) _sym_db.RegisterMessage(ModelConfig.MetricTagsEntry) _sym_db.RegisterMessage(ModelConfig.ParametersEntry) _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_LOWERBOUND_INPUTENTRY._options = None _MODELOPTIMIZATIONPOLICY_CUDA_GRAPHSPEC_INPUTENTRY._options = None _MODELOPTIMIZATIONPOLICY_EXECUTIONACCELERATORS_ACCELERATOR_PARAMETERSENTRY._options = None _MODELDYNAMICBATCHING_PRIORITYQUEUEPOLICYENTRY._options = None _MODELENSEMBLING_STEP_INPUTMAPENTRY._options = None _MODELENSEMBLING_STEP_OUTPUTMAPENTRY._options = None _MODELWARMUP_INPUTSENTRY._options = None _MODELREPOSITORYAGENTS_AGENT_PARAMETERSENTRY._options = None _MODELCONFIG_CCMODELFILENAMESENTRY._options = None _MODELCONFIG_METRICTAGSENTRY._options = None _MODELCONFIG_PARAMETERSENTRY._options = None # @@protoc_insertion_point(module_scope) ===== /workspace/red_serving_py_plugins/resources/titancaesar/base/thrift_helper.py ===== from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from thrift.TSerialization import serialize from thrift.protocol.TJSONProtocol import TSimpleJSONProtocolFactory def thrift_serialize(th_obj): """ Serialize. """ tmembuf = TTransport.TMemoryBuffer() tbinprot = TBinaryProtocol.TBinaryProtocol(tmembuf) th_obj.write(tbinprot) return tmembuf.getvalue() def thrift_deserialize(val, th_obj_type): """ Deserialize. """ th_obj = th_obj_type() tmembuf = TTransport.TMemoryBuffer(val) tbinprot = TBinaryProtocol.TBinaryProtocol(tmembuf) th_obj.read(tbinprot) return th_obj def thrift_to_json_str(thrift_object): return serialize(thrift_object, protocol_factory=TSimpleJSONProtocolFactory()).decode("utf-8") ===== /workspace/red_serving_py_plugins/resources/third_party/redserving_logger/logger.py ===== import os import sys import inspect import traceback from loguru import logger build_in_logger = None log_fmt='{time:YYYYMMDD HH:mm:ss.SSSSSS} | PLUGIN | {level} | {process.id} | {message}' def get_logger(log_path='/workspace/logs/runtime.log', log_level='INFO', format=log_fmt, rotation='00:00', retention='7 days'): # 1. check file exist or not if not os.path.exists(log_path): # 2. check folder exist or not idx = log_path.rfind("/") if idx > 0: folder_path = log_path[:idx] if not os.path.exists(folder_path): os.makedirs(folder_path) # 3. create log file os.system("touch {}".format(log_path)) global build_in_logger if build_in_logger is None: logger.remove() logger.add(sys.stderr, format=format) if os.getenv("ENABLE_LOGFILE", 0) == 1: logger.add(log_path, format=format, rotation=rotation, retention=retention) build_in_logger = logger return build_in_logger class Logger(object): def __init__(self, log_path='/workspace/logs/runtime.log', log_level='INFO', format=log_fmt, rotation='00:00', retention='7 days', index_name="red-serving", retry_times=3, use_kibana=False, agi=False): self.use_kibana = use_kibana self.build_in_logger = get_logger(log_path, log_level, format, rotation, retention) self.trace_id = "" def set_trace_id(self, trace_id): self.trace_id = trace_id def debug(self, log_info): code_stack = inspect.stack()[:2][-1] log_prefix = str(code_stack.filename.split('/')[-1]) + ":" + str(code_stack.function) + ":" + str(code_stack.lineno) + " | " + str(self.trace_id) + " | " log_info = log_prefix+self.convert_string(log_info) self.build_in_logger.debug(log_info) self.upload_online_log(log_info) def info(self, log_info): code_stack = inspect.stack()[:2][-1] log_prefix = str(code_stack.filename.split('/')[-1]) + ":" + str(code_stack.function) + ":" + str(code_stack.lineno) + " | " + str(self.trace_id) + " | " log_info = log_prefix+self.convert_string(log_info) self.build_in_logger.info(log_info) self.upload_online_log(log_info) def warning(self, log_info): code_stack = inspect.stack()[:2][-1] log_prefix = str(code_stack.filename.split('/')[-1]) + ":" + str(code_stack.function) + ":" + str(code_stack.lineno) + " | " + str(self.trace_id) + " | " log_info = log_prefix+self.convert_string(log_info) self.build_in_logger.warning(log_info) self.upload_online_log(log_info) def error(self, log_info): code_stack = inspect.stack()[:2][-1] log_prefix = str(code_stack.filename.split('/')[-1]) + ":" + str(code_stack.function) + ":" + str(code_stack.lineno) + " | " + str(self.trace_id) + " | " log_info = log_prefix+self.convert_string(log_info) self.build_in_logger.error(log_info) self.upload_online_log(log_info) def critical(self, log_info): code_stack = inspect.stack()[:2][-1] log_prefix = str(code_stack.filename.split('/')[-1]) + ":" + str(code_stack.function) + ":" + str(code_stack.lineno) + " | " + str(self.trace_id) + " | " log_info = log_prefix+self.convert_string(log_info) self.build_in_logger.critical(log_info) self.upload_online_log(log_info) def upload_online_log(self, log_info): if self.use_kibana: self.online_logger.upload_log(body={'redservinglog': log_info}) def convert_string(self, log_info): try: if not isinstance(log_info, str): log_info = str(log_info) except: self.build_in_logger.error(traceback.format_exc()) return log_info ===== /workspace/red_serving_py_plugins/resources/third_party/redserving_logger/online_logger.py ===== import os import logging import traceback from elasticsearch import Elasticsearch from threading import Thread from datetime import datetime, timezone, timedelta ES_HOST_MAP = {'prod' : 'es9076-exp.int.xiaohongshu.com:80', 'staging' : 'es9076-exp.int.xiaohongshu.com:80', 'sit' : '10.4.45.154:9228'} AGI_ES_HOST_MAP = {'prod' : 'http://10.13.13.137:80', 'staging' : 'http://10.13.13.137:80', 'sit' : 'es-searcher04-sit.int.xiaohongshu.com:80'} class OnlineLogger: def __init__(self, logger=None, index_name="red-serving", retry_times=3, agi=False): self.retry_times = retry_times utc_dt = datetime.utcnow().replace(tzinfo=timezone.utc) cn_dt = utc_dt.astimezone(timezone(timedelta(hours=8))) self.now_date = cn_dt.strftime('%Y.%m.%d') self.index_name = index_name self.index = self.index_name + '-' + self.now_date self.keys = ['HOSTNAME', 'SERVICE_ID', 'CONSUL_AGENT', 'KUBERNETES_SERVICE_HOST', 'KUBERNETES_SERVICE_PORT', 'INSTANCE_IP', 'HOST_IP'] assert (logger is not None) self.logger = logger self.agi = agi host_map = AGI_ES_HOST_MAP if self.agi else ES_HOST_MAP env_dist = os.environ try: self.es = Elasticsearch( host_map[env_dist.get('XHS_ENV', 'prod')], sniff_on_start=True, sniff_on_connection_fail=True, sniff_timeout=60 ) self.es.indices.create(index=self.index, ignore=400) except: self.logger.error(traceback.format_exc()) def async_run(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() return wrapper def retry(func): def wrapper(self, *args, **kwargs): i = 0 while i < self.retry_times: try: return func(self, *args, **kwargs) except: i += 1 self.logger.warning("Upload log to ES, Retry {} times".format(i)) return wrapper @async_run @retry def upload_log(self, body): """ param body: contain log info return: None """ utc_dt = datetime.utcnow().replace(tzinfo=timezone.utc) cn_dt = utc_dt.astimezone(timezone(timedelta(hours=8))) now_date = cn_dt.strftime('%Y.%m.%d') if now_date != self.now_date: self.now_date = now_date if self.agi: self.index = self.index_name else: self.index = self.index_name + '-' + self.now_date try: self.es.indices.create(index=self.index, ignore=400) except: self.logger.error(traceback.format_exc()) try: now = cn_dt.strftime("%Y-%m-%dT%H:%M:%S%z") body['date'] = now for key in self.keys: if key in os.environ: body[key] = os.environ[key] self.es.index(index=self.index, body=body, doc_type='_doc') except: self.logger.error(traceback.format_exc()) ===== /workspace/red_serving_py_plugins/resources/third_party/redserving_logger/__init__.py ===== from .logger import Logger ===== /workspace/red_serving_py_plugins/resources/third_party/EventLogger/event_logger.py ===== # coding=utf-8 import json import logging.handlers import os import random import re import base64 import errno import socket import time import EventLogger.Record_pb2 as Record_pb2 from threading import Lock try: import codecs except ImportError: codecs = None suffix = "%Y-%m-%d-%H-%M.%S" extMatch = re.compile(r"\d{4}-\d{2}-\d{2}-\d{2}-\d{2}\.\d{2}\.\d{5}") maxBytes = 200 * 1024 * 1024 rollover_interval = 1 backupCount = 60 * 24 * 1 _MIDNIGHT = 24 * 60 * 60 lock = Lock() class EventLogFileHandler(logging.handlers.TimedRotatingFileHandler): def emit_without_new_line(self, record): try: msg = record.getMessage() msg = base64.decodebytes(msg.encode()) self.stream.write(msg) self.flush() except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record) def emit(self, record): """ Emit a record. Output the record to the file, catering for rollover as described in doRollover(). """ try: if self.shouldRollover(record): self.doRollover() if self.stream is None: self.stream = self._open() self.emit_without_new_line(record) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record) def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ if self.stream: self.stream.close() self.stream = None # get the time that this sequence started at and make it a TimeTuple currentTime = int(time.time()) dstNow = time.localtime(currentTime)[-1] # Issue 18940: A file may not have been created if delay is True. if self.backupCount > 0: for s in self.getFilesToDelete(): if os.path.exists(s): try : os.remove(s) except OSError: pass if not self.delay: self.stream = self._open() newRolloverAt = self.computeRollover(currentTime) while newRolloverAt <= currentTime: newRolloverAt = newRolloverAt + self.interval # If DST changes and midnight or weekly rollover, adjust for this. if (self.when == 'MIDNIGHT' or self.when.startswith('W')) and not self.utc: dstAtRollover = time.localtime(newRolloverAt)[-1] if dstNow != dstAtRollover: if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour addend = -3600 else: # DST bows out before next rollover, so we need to add an hour addend = 3600 newRolloverAt += addend self.rolloverAt = newRolloverAt def computeRollover(self, currentTime): """ Work out the rollover time based on the specified time. """ if not hasattr(self, "rolloverAt"): return 0 result = (currentTime + self.interval) / 60 * 60 # If we are rolling over at midnight or weekly, then the interval is already known. # What we need to figure out is WHEN the next interval is. In other words, # if you are rolling over at midnight, then your base interval is 1 day, # but you want to start that one day clock at midnight, not now. So, we # have to fudge the rolloverAt value in order to trigger the first rollover # at the right time. After that, the regular interval will take care of # the rest. Note that this code doesn't care about leap seconds. :) if self.when == 'MIDNIGHT' or self.when.startswith('W'): # This could be done with less code, but I wanted it to be clear if self.utc: t = time.gmtime(currentTime) else: t = time.localtime(currentTime) currentHour = t[3] currentMinute = t[4] currentSecond = t[5] # r is the number of seconds left between now and midnight r = _MIDNIGHT - ((currentHour * 60 + currentMinute) * 60 + currentSecond) result = currentTime + r # If we are rolling over on a certain day, add in the number of days until # the next rollover, but offset by 1 since we just calculated the time # until the next day starts. There are three cases: # Case 1) The day to rollover is today; in this case, do nothing # Case 2) The day to rollover is further in the interval (i.e., today is # day 2 (Wednesday) and rollover is on day 6 (Sunday). Days to # next rollover is simply 6 - 2 - 1, or 3. # Case 3) The day to rollover is behind us in the interval (i.e., today # is day 5 (Saturday) and rollover is on day 3 (Thursday). # Days to rollover is 6 - 5 + 3, or 4. In this case, it's the # number of days left in the current week (1) plus the number # of days in the next week until the rollover day (3). # The calculations described in 2) and 3) above need to have a day added. # This is because the above time calculation takes us to midnight on this # day, i.e. the start of the next day. if self.when.startswith('W'): day = t[6] # 0 is Monday if day != self.dayOfWeek: if day < self.dayOfWeek: daysToWait = self.dayOfWeek - day else: daysToWait = 6 - day + self.dayOfWeek + 1 newRolloverAt = result + (daysToWait * (60 * 60 * 24)) if not self.utc: dstNow = t[-1] dstAtRollover = time.localtime(newRolloverAt)[-1] if dstNow != dstAtRollover: if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour addend = -3600 else: # DST bows out before next rollover, so we need to add an hour addend = 3600 newRolloverAt += addend result = newRolloverAt return result def _open(self): """ Open the current base file with the (original) mode and encoding. Return the resulting stream. """ base_file = self.baseFilename + "." + time.strftime(suffix, time.localtime()) + ".rio2" base_dir = os.path.split(base_file)[0] if not os.path.exists(base_dir): try: os.makedirs(base_dir) except OSError as e: if e.errno == errno.EEXIST: print(base_dir + ' already exists') else : print('Unkonwn error') stream = open(base_file, 'ab') return stream def shouldRollover(self, record): """ Determine if rollover should occur. Basically, see if the supplied record would cause the file to exceed the size limit we have. """ t = int(time.time()) if t >= self.rolloverAt: return 1 if self.stream is None: # delay was set... # print('self.stream is None, shouldRollover open it') self.stream = self._open() if self.maxBytes > 0: # are we rolling over? self.stream.seek(0, 2) # due to non-posix-compliant Windows feature if self.stream.tell() >= self.maxBytes: # print('self.stream.tell() >= self.maxBytes ' + str(self.stream.tell())) return 1 return 0 def getFilesToDelete(self): """ Determine the files to delete when rolling over. More specific than the earlier method, which just used glob.glob(). """ dirName, baseName = os.path.split(self.baseFilename) try: fileNames = os.listdir(dirName) except OSError as e: if e.errno == errno.ENOENT: return [] result = [] prefix = baseName + "." plen = len(prefix) for fileName in fileNames: if fileName[:plen] == prefix: suffix = fileName[plen:] if self.extMatch.match(suffix): result.append(os.path.join(dirName, fileName)) result.sort() if len(result) < self.backupCount: result = [] else: result = result[:len(result) - self.backupCount] return result class EventLogger: def __init__(self, log_file): self.logger = logging.getLogger(log_file) if not hasattr(self.logger, "isInit"): lock.acquire() try: if not hasattr(self.logger, "isInit"): init_event_logger(log_file) finally: lock.release() def log(self, content): record = Record_pb2.Record() record.version = "1" record.header.timestamp = int(round(time.time() * 1000)) record.header.weight = 1 record.header.appId = "1" record.header.bodyVersion = "1" record.header.messageType = Record_pb2.JSON record.body = json.dumps(content).encode() record_serialized = record.SerializeToString() length = len(record_serialized) # result = ''.join([chr(length >> i & 0xff) for i in (24, 16, 8, 0)]).encode() # result = ''.join([hex(length >> i & 0xff) for i in (24, 16, 8, 0)]).encode() result = length.to_bytes(4, byteorder='big') result = result + record_serialized result = base64.encodebytes(result).decode() self.logger.info(result) def init_event_logger(log_file): base_dir = '/data/agent-smith/' + log_file logger = logging.getLogger(log_file) logger.isInit = True logger.propagate = False base_filename = f"{base_dir}/{log_file}.{getPID()}.{getHostname()}" handler = EventLogFileHandler(base_filename, when='M', interval=rollover_interval, backupCount=backupCount, delay=True) handler.delay = True handler.suffix = suffix handler.extMatch = extMatch handler.maxBytes = maxBytes logger.addHandler(handler) logger.setLevel(logging.INFO) def getPID(): return os.getpid() def getHostname(): return socket.gethostname() ===== /workspace/red_serving_py_plugins/resources/third_party/EventLogger/__init__.py ===== from .event_logger import EventLogger ===== /workspace/red_serving_py_plugins/resources/third_party/EventLogger/Record_pb2.py ===== # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: EventLogger/Record.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='EventLogger/Record.proto', package='com.red.platform.log.event', syntax='proto3', serialized_options=b'B\013EventRecord', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x18\x45ventLogger/Record.proto\x12\x1a\x63om.red.platform.log.event\"a\n\x06Record\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x38\n\x06header\x18\x02 \x01(\x0b\x32(.com.red.platform.log.event.RecordHeader\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\"\x8d\x02\n\x0cRecordHeader\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x0e\n\x06weight\x18\x02 \x01(\x01\x12\r\n\x05\x61ppId\x18\x03 \x01(\t\x12\x13\n\x0b\x62odyVersion\x18\x04 \x01(\t\x12<\n\x0bmessageType\x18\x05 \x01(\x0e\x32\'.com.red.platform.log.event.MessageType\x12\x36\n\x08\x65ndpoint\x18\x06 \x01(\x0e\x32$.com.red.platform.log.event.Endpoint\x12@\n\rhttpExtraInfo\x18\x07 \x01(\x0b\x32).com.red.platform.log.event.HttpExtraInfo\"\xbe\x03\n\rHttpExtraInfo\x12\x16\n\x0e\x63ollect_tstamp\x18\x01 \x01(\x03\x12\x18\n\x10\x63ollect_hostname\x18\x02 \x01(\t\x12\x16\n\x0ehttp_remote_ip\x18\x0b \x01(\t\x12\x1b\n\x13http_request_method\x18\x0c \x01(\t\x12\x18\n\x10http_request_uri\x18\r \x01(\t\x12\x13\n\x0bhttp_status\x18\x0e \x01(\x05\x12\x1c\n\x14http_body_bytes_sent\x18\x0f \x01(\x05\x12\x14\n\x0chttp_referer\x18\x10 \x01(\t\x12\x17\n\x0fhttp_user_agent\x18\x11 \x01(\t\x12\x13\n\x0b\x63lient_lang\x18\x12 \x01(\t\x12\x1c\n\x14validate_result_code\x18\x17 \x01(\x05\x12]\n\x13validate_extra_info\x18\x18 \x03(\x0b\x32@.com.red.platform.log.event.HttpExtraInfo.ValidateExtraInfoEntry\x1a\x38\n\x16ValidateExtraInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x1f\n\x0bMessageType\x12\x08\n\x04JSON\x10\x00\x12\x06\n\x02PB\x10\x01*)\n\x08\x45ndpoint\x12\x0b\n\x07TRACKER\x10\x00\x12\x07\n\x03LNG\x10\x01\x12\x07\n\x03REX\x10\x02\x42\rB\x0b\x45ventRecordb\x06proto3' ) _MESSAGETYPE = _descriptor.EnumDescriptor( name='MessageType', full_name='com.red.platform.log.event.MessageType', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='JSON', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PB', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=876, serialized_end=907, ) _sym_db.RegisterEnumDescriptor(_MESSAGETYPE) MessageType = enum_type_wrapper.EnumTypeWrapper(_MESSAGETYPE) _ENDPOINT = _descriptor.EnumDescriptor( name='Endpoint', full_name='com.red.platform.log.event.Endpoint', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='TRACKER', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='LNG', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='REX', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=909, serialized_end=950, ) _sym_db.RegisterEnumDescriptor(_ENDPOINT) Endpoint = enum_type_wrapper.EnumTypeWrapper(_ENDPOINT) JSON = 0 PB = 1 TRACKER = 0 LNG = 1 REX = 2 _RECORD = _descriptor.Descriptor( name='Record', full_name='com.red.platform.log.event.Record', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='version', full_name='com.red.platform.log.event.Record.version', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='header', full_name='com.red.platform.log.event.Record.header', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='body', full_name='com.red.platform.log.event.Record.body', index=2, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=56, serialized_end=153, ) _RECORDHEADER = _descriptor.Descriptor( name='RecordHeader', full_name='com.red.platform.log.event.RecordHeader', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='timestamp', full_name='com.red.platform.log.event.RecordHeader.timestamp', index=0, number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='weight', full_name='com.red.platform.log.event.RecordHeader.weight', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='appId', full_name='com.red.platform.log.event.RecordHeader.appId', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bodyVersion', full_name='com.red.platform.log.event.RecordHeader.bodyVersion', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='messageType', full_name='com.red.platform.log.event.RecordHeader.messageType', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='endpoint', full_name='com.red.platform.log.event.RecordHeader.endpoint', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='httpExtraInfo', full_name='com.red.platform.log.event.RecordHeader.httpExtraInfo', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=156, serialized_end=425, ) _HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY = _descriptor.Descriptor( name='ValidateExtraInfoEntry', full_name='com.red.platform.log.event.HttpExtraInfo.ValidateExtraInfoEntry', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='key', full_name='com.red.platform.log.event.HttpExtraInfo.ValidateExtraInfoEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='value', full_name='com.red.platform.log.event.HttpExtraInfo.ValidateExtraInfoEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=b'8\001', is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=818, serialized_end=874, ) _HTTPEXTRAINFO = _descriptor.Descriptor( name='HttpExtraInfo', full_name='com.red.platform.log.event.HttpExtraInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='collect_tstamp', full_name='com.red.platform.log.event.HttpExtraInfo.collect_tstamp', index=0, number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='collect_hostname', full_name='com.red.platform.log.event.HttpExtraInfo.collect_hostname', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_remote_ip', full_name='com.red.platform.log.event.HttpExtraInfo.http_remote_ip', index=2, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_request_method', full_name='com.red.platform.log.event.HttpExtraInfo.http_request_method', index=3, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_request_uri', full_name='com.red.platform.log.event.HttpExtraInfo.http_request_uri', index=4, number=13, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_status', full_name='com.red.platform.log.event.HttpExtraInfo.http_status', index=5, number=14, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_body_bytes_sent', full_name='com.red.platform.log.event.HttpExtraInfo.http_body_bytes_sent', index=6, number=15, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_referer', full_name='com.red.platform.log.event.HttpExtraInfo.http_referer', index=7, number=16, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='http_user_agent', full_name='com.red.platform.log.event.HttpExtraInfo.http_user_agent', index=8, number=17, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='client_lang', full_name='com.red.platform.log.event.HttpExtraInfo.client_lang', index=9, number=18, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='validate_result_code', full_name='com.red.platform.log.event.HttpExtraInfo.validate_result_code', index=10, number=23, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='validate_extra_info', full_name='com.red.platform.log.event.HttpExtraInfo.validate_extra_info', index=11, number=24, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[_HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=428, serialized_end=874, ) _RECORD.fields_by_name['header'].message_type = _RECORDHEADER _RECORDHEADER.fields_by_name['messageType'].enum_type = _MESSAGETYPE _RECORDHEADER.fields_by_name['endpoint'].enum_type = _ENDPOINT _RECORDHEADER.fields_by_name['httpExtraInfo'].message_type = _HTTPEXTRAINFO _HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY.containing_type = _HTTPEXTRAINFO _HTTPEXTRAINFO.fields_by_name['validate_extra_info'].message_type = _HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY DESCRIPTOR.message_types_by_name['Record'] = _RECORD DESCRIPTOR.message_types_by_name['RecordHeader'] = _RECORDHEADER DESCRIPTOR.message_types_by_name['HttpExtraInfo'] = _HTTPEXTRAINFO DESCRIPTOR.enum_types_by_name['MessageType'] = _MESSAGETYPE DESCRIPTOR.enum_types_by_name['Endpoint'] = _ENDPOINT _sym_db.RegisterFileDescriptor(DESCRIPTOR) Record = _reflection.GeneratedProtocolMessageType('Record', (_message.Message,), { 'DESCRIPTOR' : _RECORD, '__module__' : 'EventLogger.Record_pb2' # @@protoc_insertion_point(class_scope:com.red.platform.log.event.Record) }) _sym_db.RegisterMessage(Record) RecordHeader = _reflection.GeneratedProtocolMessageType('RecordHeader', (_message.Message,), { 'DESCRIPTOR' : _RECORDHEADER, '__module__' : 'EventLogger.Record_pb2' # @@protoc_insertion_point(class_scope:com.red.platform.log.event.RecordHeader) }) _sym_db.RegisterMessage(RecordHeader) HttpExtraInfo = _reflection.GeneratedProtocolMessageType('HttpExtraInfo', (_message.Message,), { 'ValidateExtraInfoEntry' : _reflection.GeneratedProtocolMessageType('ValidateExtraInfoEntry', (_message.Message,), { 'DESCRIPTOR' : _HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY, '__module__' : 'EventLogger.Record_pb2' # @@protoc_insertion_point(class_scope:com.red.platform.log.event.HttpExtraInfo.ValidateExtraInfoEntry) }) , 'DESCRIPTOR' : _HTTPEXTRAINFO, '__module__' : 'EventLogger.Record_pb2' # @@protoc_insertion_point(class_scope:com.red.platform.log.event.HttpExtraInfo) }) _sym_db.RegisterMessage(HttpExtraInfo) _sym_db.RegisterMessage(HttpExtraInfo.ValidateExtraInfoEntry) DESCRIPTOR._options = None _HTTPEXTRAINFO_VALIDATEEXTRAINFOENTRY._options = None # @@protoc_insertion_point(module_scope) ===== /workspace/red_serving_py_plugins/resources/py_red_serving.py ===== # -*- coding: utf-8 -*- import sys import copy import json import traceback import yaml from operator import mod from colored import fg, bg, attr from collections import OrderedDict import red_serving_def from py_infer_params import PyInferParameter as InferParameter from py_infer_params import RequestType, PyTensor from red_serving_tool_debug import PyRemoteInferPlugin import numpy as np # 只有local_debug会import此文件 # 因此在此专门给local_debug设置loguru的格式 from loguru import logger import sys # 去掉redserving_logger的格式 logger.remove() # 重新添加简易格式的log logger.add(sys.stderr , colorize=True , format='[{level}] {name}:{function}:{line} - {message}') def lrt_dtype_to_np_dtype(lrt_dtype): import TopsInference lrt_dtype_to_np_dtype_map = { TopsInference.TIF_UINT8: "uint8", TopsInference.TIF_INT8: "int8", TopsInference.TIF_UINT16: "uint16", TopsInference.TIF_INT16: "int16", TopsInference.TIF_UINT32: "uint32", TopsInference.TIF_INT32: "int32", TopsInference.TIF_UINT64: "uint64", TopsInference.TIF_INT64: "int64", TopsInference.TIF_FP32: "float32", TopsInference.TIF_FP16: "float16", TopsInference.TIF_FP64: "float64", TopsInference.TIF_BOOL: "bool", } return lrt_dtype_to_np_dtype_map[lrt_dtype] def print_string_or_bytes(data): if isinstance(data, bytes): return "{}[skip print as is a bytes list]{}".format(fg('green'),attr('reset')) else: return data def print_infer_parameter_list(result, dtype): for i, param in enumerate(result): if param.param_type() == 0: input_map = param.input_map() if "RpcRes" in input_map: if dtype == RequestType.RPCRESOURCE: from aimedia.modelinterface.ttypes import ResourceResponse print("{}RPC response:{}\n{}\n".format(fg('green'),attr('reset'), red_serving_def.DeserializeThrift(input_map["RpcRes"], ResourceResponse))) elif dtype == RequestType.HTTPRESOURCE: print("{}HTTP response:{}\n{}\n".format(fg('green'),attr('reset'), json.loads(input_map["RpcRes"]))) if "HiveRecord" in input_map: print("{}Hive Record:{}\n{}\n".format(fg('green'),attr('reset'), json.loads(input_map["HiveRecord"]))) if "CacheKey" in input_map: print("{}RedKv Key:{}{}\n{}Value:{}\n{}\n".format(fg('green'),attr('reset'), input_map["CacheKey"], fg('green'),attr('reset'),print_string_or_bytes(input_map["CacheValue"]))) def print_split_line1(title): print("%s################ %s ####################%s" % (fg('orchid'), title, attr('reset'))) def print_split_line2(): print("----------------------------------------") def print_sys_msg(msg): print("{}{}{}".format(fg('green'), msg, attr('reset'))) def print_user_msg(msg): print("{}{}{}".format(fg('blue'), msg, attr('reset'))) def print_warning_msg(msg): pass def print_error_msg(msg): print("{}{}{}".format(fg('yellow'), msg, attr('reset'))) class InferCore(object): def __init__(self, device): self.support_model_types = ["torchscript", "torch", "tensorrt", "onnx", "lightruntime", "mindspore_lite"] self.model = {} self.device = device @staticmethod def guess_model_type(model_type): if model_type == "pt" or model_type == "jit": return "torchscript" if model_type == "onnx": return "onnx" if model_type == "plan" or model_type == "trt" or model_type == "engine": return "tensorrt" if model_type == "lrt": return "lightruntime" if model_type in ['mindir']: return "mindspore_lite" def add_model(self, model_config): model_name = model_config["model_name"] model_path = model_config["model_path"] model_repo_path = model_config["model_repo_path"] model_placement = model_config["model_placement"] model_type = None ret = False if "model_type" in model_config.keys(): model_type = model_config["model_type"] try: if model_type == "torchscript" or model_type == "torch": import torch self.model[model_name] = (torch.jit.load(model_path).to(self.device).eval(), model_type, model_name) ret = True else: from redserving_model_manager_sdk import InferConfig, InferEngine, SCHEDULER_SIMPLE infer_conf = InferConfig(model_name, model_placement, model_repo_path) infer_conf.SetSchedConf(SCHEDULER_SIMPLE) if model_placement == "cos": infer_conf.SetFileSystemConf(using_decoder=True) engine = InferEngine([infer_conf]) self.model[model_name] = (engine, model_type, model_name) ret = engine.ModelReady(model_name) print_sys_msg("Load(model_name: {}, model_path: {}, model_type: {}): success".format(model_name, model_path, model_type)) except: print_error_msg("Error happend when load model: {}".format(model_name)) traceback.print_exc() return ret def infer(self, trace_id, model_name, infer_data): output_np_data = [] try: model = self.model[model_name] if model[1] == "torchscript" or model[1] == "torch": import torch tensor_data = [] for data in infer_data: tensor_data.append(torch.from_numpy(data.as_numpy()).to(self.device)) with torch.no_grad(): output = model[0].forward(*tensor_data) if isinstance(output, (list, tuple)): for i in range(len(output)): output_np_data.append(PyTensor("OUTPUT__"+str(i),output[i].detach().cpu().numpy())) else: output_np_data.append(PyTensor("OUTPUT__0",output.detach().cpu().numpy())) else: input_np_data = {} for tensor in infer_data: input_np_data[tensor.name()] = tensor.as_numpy() output = model[0].Forward(model_name, input_np_data) for output_name in output[1]: output_np_data.append(PyTensor(output_name, output[1][output_name])) except: print_error_msg("Error happend when running model inference: {}".format(model_name)) self.alive = False traceback.print_exc() return output_np_data class PyRedServing(object): def __init__(self, params): self.params = params #self.inferparams_list = [] self.bls_mode = False self.inferparams_map = {} self.support_model_types = ["torchscript", "torch", "tensorrt", "onnx", "lightruntime", "mindspore_lite"] self.alive = True self.ready = self.load_model() self.serving_caches = [] if self.ready: self.ready = self.load_config() def load_model(self, ): ret = False try: print_split_line1("load model") device = self.params['device'] self.infer_core = InferCore(device) for model_config in self.params["model"]: ret = self.infer_core.add_model(model_config) if ret is not True : self.alive = False return ret except: self.alive = False print_error_msg("Error happend when load model: {}".format(model_name)) traceback.print_exc() return True def load_config(self, ): if self.alive is False: return try: print_split_line1("load config") if self.params.get("config", None) is None: print_error_msg("config is None") self.alive = False return False else: with open(self.params["config"], 'r', encoding="utf-8") as f: file_data = f.read() self.config = yaml.load_all(file_data, Loader=yaml.FullLoader) self.plugins = {} self.class_objs = {} self.nodes = [] for data in self.config: if "python_plugins" in data.keys(): for conf in data["python_plugins"]: self.plugins[conf["name"]] = conf sys.path.append(conf["py_module_path"]) module_name = __import__(conf["py_module_name"]) InferenceClass = getattr(module_name, conf["py_class_name"]) self.class_objs[conf['py_class_name']] = (InferenceClass(),conf["py_func_names"]) if len(self.plugins) == 0: print_error_msg("plugins empty") self.alive = False return False if "workflow_type" in data.keys(): if data["workflow_type"] == "bls": self.bls_mode = True if "workflows" in data.keys() and len(data["workflows"][0]["nodes"])>0: node_idx = 0 for node in data["workflows"][0]["nodes"]: class_obj = None if node["type"] == "py_plugin": py_class_name = self.plugins[node["conf"]["name"]]["py_class_name"] class_obj = self.class_objs[py_class_name][0] self.nodes.append({ "index" : node_idx, "process_stage" : node["conf"].get("process_stage", None), "name" : node["conf"]["name"], "stage_name" : node["name"], "class_obj" : class_obj, "type" : node["type"], "dependency" : node["dependency"], }) node_idx += 1 else: self.bls_mode = True if self.bls_mode: for name, class_obj in self.class_objs.items(): remote_infer_obj = PyRemoteInferPlugin(self.infer_core) class_obj[0].reset_remote_infer_handler(remote_infer_obj) self.nodes.append({ "index":0, "process_stage" : class_obj[1][0], "name" : class_obj[1][0], "stage_name": name, "class_obj": class_obj[0], "type": "py_plugin", "dependency": [], }) for i, node in enumerate(self.nodes): print("node {}, process_stage: {}, name: {}, type: {}".format(i, node["process_stage"], node["name"], node["type"])) print_sys_msg("load config success.") except: print_error_msg("Error happend when process: load_config") self.alive = False traceback.print_exc() return False return True def processor(self, data, dtype=RequestType.UNKNOWN): if self.ready is not True: print_error_msg("py_engine init failed. Process exist here.") return [] node_index = 0 inferparams = [] print_split_line1("start process") try: for i, node in enumerate(self.nodes): if self.alive is False: return [] print_split_line1("step {}".format(i)) print_sys_msg("start process node {}(process_stage: {}, name: {}, type: {})...".format(i, node["process_stage"], node["name"], node["type"])) inferparams = [] if node_index == 0 : inferparams = self.set_input_data(data, dtype=dtype) else: for stage_name in node["dependency"]: inferparams.extend(self.inferparams_map[stage_name]) node_index = node_index + 1 if len(inferparams) == 0: print_error_msg("node input param is None") return inferparams for _, param in enumerate(inferparams): print_split_line2() print_sys_msg("[process inner params]") tmp_type = "cache" if param.param_type() == 1 else "infer_params" if tmp_type == "cache": print("[cache data]: {}".format(param.param_name()[18:])) else: print("[input data]:") if len(param.input_map()) > 0: for k in param.input_map(): print("data-as-dict\n\tkey: {},\n\tvalue: {}".format(k,print_string_or_bytes(param.input_map()[k]))) if len(param.input_string()) > 0: print("data: {}".format(print_string_or_bytes(param.input_string()))) for j, tensor in enumerate(param.input_tensors()): print("data-as-tensor:\n\tname: {},\n\tshape: {},\n\tdtype: {}".format(tensor.name(), tensor.shape(), tensor.dtype())) ntype = node["type"] if ntype == "model_infer": name = node["name"] inferparams = self.infer(name, inferparams) self.inferparams_map[node["stage_name"]] = inferparams elif ntype == "py_plugin": print_split_line2() print_user_msg("[user-defined-logs]") process_stage = node["process_stage"] class_obj = node["class_obj"] if i == 0 or i == len(self.nodes) - 1: inferparams = getattr(class_obj, process_stage)(inferparams) else: tmp_inferparams_list = getattr(class_obj, process_stage)(inferparams) for param in inferparams: if param.param_type() == 1: # copy cache to the next step #tmp_inferparams_list.append(param) self.serving_caches.append(param) for param in self.serving_caches: tmp_inferparams_list.append(param) inferparams = tmp_inferparams_list self.inferparams_map[node["stage_name"]] = inferparams if self.check_terminate(inferparams) is True: print_sys_msg("`terminate` is set as True, End the workflow here.") break print_split_line2() else: print_error_msg("type: {} is error!".format(ntype)) # all node done print_infer_parameter_list(inferparams, dtype) except: print_error_msg("Error happend when process: processor") traceback.print_exc() return inferparams def check_terminate(self, inferparams_list): terminate = False for params in inferparams_list: if red_serving_def.DefaultControlKeyPrefix+"terminate_workflow" in params.input_map(): terminate = True break return terminate def set_input_data(self, data, dtype=RequestType.UNKNOWN): inferparams_list = [] try: if isinstance(dtype, RequestType) is False: print_error_msg("type not in RequestType, {}".format(dtype)) self.alive = False return inferparams_list if dtype == RequestType.MQ: if isinstance(data, str): self.infer_parameter = InferParameter("0", data, requestType=RequestType.MQ) else: self.infer_parameter = InferParameter("0", data.SerializeToString(), requestType=RequestType.MQ) elif dtype == RequestType.RPCRESOURCE: serialize_request = red_serving_def.SerializeThrift(data) self.infer_parameter = InferParameter("0", serialize_request, requestType=RequestType.RPCRESOURCE) elif dtype == RequestType.HTTPRESOURCE: http_data = data if not isinstance(http_data, str): http_data = json.dumps(http_data) self.infer_parameter = InferParameter("0", http_data, requestType=RequestType.HTTPRESOURCE) else: print_error_msg("dtype {} not support!".format(dtype.name)) self.alive = False inferparams_list = [] return inferparams_list inferparams_list = [self.infer_parameter] except: print_error_msg("Error happend when set_input_data") self.alive = False traceback.print_exc() return inferparams_list def infer(self, model_name, preprocess_response_list): output_datas = [] try: self.preprocess_response_list = preprocess_response_list inferparams, infer_data = None, None for param in self.preprocess_response_list: if param.param_type() == 0: inferparams = param break infer_data = inferparams.input_tensors() if infer_data is None or len(infer_data) == 0: print_error_msg("infer_data is None") self.alive = False return output_datas output_np_data = self.infer_core.infer("", model_name, infer_data) output_map = copy.deepcopy(inferparams.input_map()) output_map[red_serving_def.DefaultModelNameKey] = model_name infer_res = InferParameter(inferparams.trace_id(), "", output_map, output_np_data) output_datas = [infer_res] for param in preprocess_response_list: if param.param_type() == 1: output_datas.append(param) except: print_error_msg("Error happend when preparing for model infer") self.alive = False traceback.print_exc() return output_datas ===== /workspace/red_serving_py_plugins/resources/svc_downloader.py ===== import os import base64 import json import traceback import time import sys from typing import List from loguru import logger import argparse import oss2 import yaml from tqdm import tqdm from redserving_toolkit.oss_util import OssClient from redserving_toolkit.cos_util import CosClient from redserving_toolkit.apollo_client import InnerApolloClient def get_version(path): pos = path.find('/') if pos == -1: return "" else: return path[:pos] def drop_version(path): pos = path.find('/') if pos == -1: return path else: return path[pos+1:] def check_success_file(directory): success_file_path = os.path.join(directory, "success") if os.path.exists(success_file_path): return True return None class DownloadItem: def __init__(self, name: str, model_placement: str, model_repo_path: str, download_type=None, region="shanghai", prefix=None, version=None, model_repo_bucket=None, model_repo_secret_key=None, model_repo_access_key=None, **kwargs) -> None: self.name: str = name self.download_type: str = download_type self.model_placement: str = model_placement self.model_repo_path: str = model_repo_path self.region: str = region self.prefix: str = prefix self.version: str = version self.kwargs = kwargs def is_local(self): return self.model_placement == 'local' def get_download_type(self): return self.download_type def skip(self): return self.download_type is None def get_placement(self): return self.model_placement def get_remote_prefix(self): return os.path.join(self.model_repo_path, self.name) def get_local_prefix(self, default_prefix=None): if self.prefix: return self.prefix if self.is_local(): local_model_path = os.path.join(self.model_repo_path, self.name) if self.version is None: dir_list = os.listdir(local_model_path) list.sort(dir_list) local_model_path = os.path.join(local_model_path, dir_list[-1]) else: local_model_path = os.path.join(local_model_path, self.version) return local_model_path else: return os.path.join(default_prefix, self.name) def get_version(self): return self.version def download_svc(args): svc_config = None try: if args.svc_config_path: with open(args.svc_config_path) as f: svc_config = yaml.safe_load(f) elif args.apollo_svc: client = InnerApolloClient().get_apollo_client() cfg_content = client.get_value(args.apollo_svc, namespace=args.apollo_ns) svc_config = yaml.safe_load(cfg_content) except: traceback.print_exc() return svc_config def parse_svc_and_download(args): try: if args.svc_config_path: with open(args.svc_config_path) as f: svc_config = yaml.safe_load(f) elif args.apollo_svc: client = InnerApolloClient().get_apollo_client() cfg_content = client.get_value(args.apollo_svc, namespace=args.apollo_ns) svc_config = yaml.safe_load(cfg_content) if svc_config is None: return None, False downloads: List[dict] = None download_from_settings = False if 'model_downloads' in svc_config: downloads = svc_config['model_downloads'] logger.info("download from 'model_downloads'...") download_from_settings = False elif 'model_settings' in svc_config: downloads = [] for item in svc_config['model_settings'] : if "rpc_config" not in item: downloads.append(item) logger.info("download from 'model_settings'...") download_from_settings = True if downloads is None or downloads == []: logger.warning("downloads is None, no need to download models") return svc_config, True default_prefix = os.environ.get("SVC_DOWNLOAD_PREFIX", "/workspace/models/") model_deploys = {} for item in downloads: model = DownloadItem(**item) if download_from_settings and model.skip() and not args.offline_batching: continue if not model.is_local(): storage_client = None if model.get_placement() == 'oss': lst = model.model_repo_path.split('/') if len(lst) < 2: logger.error("invalid model_repo_path: {}".format(model.model_repo_path)) team = lst[1] storage_client = OssClient(region=model.region, team=team) elif model.get_placement() == 'cos': storage_client = CosClient() local_prefix = model.get_local_prefix(default_prefix) remote_prefix = model.get_remote_prefix() start_time = time.time() with_version = False if os.environ.get("SVC_DOWNLOAD_WITH_VERSION"): with_version = bool(int(os.environ.get("SVC_DOWNLOAD_WITH_VERSION"))) ret, download_version = storage_client.download_path( remote_prefix, local_prefix, version=model.get_version(), num_threads=10, include_version=with_version) if ret is not True: logger.error("model file download Failed! info:\n{}".format(ret)) return None, False if with_version: local_prefix = os.path.join(local_prefix, download_version) logger.info("model was downloaded to {}, version is :{}, cost: {} min".format(local_prefix, download_version, (time.time() - start_time) // 60)) model_deploys[model.name] = { "path": local_prefix, "version": download_version, "remote": remote_prefix, "placement": model.get_placement(), "kwargs": model.kwargs } python_path = os.environ.get('PYTHONPATH', '') # Prepend the model path to PYTHONPATH if python_path: python_path = local_prefix + os.pathsep + python_path else: python_path = local_prefix # Set the modified PYTHONPATH os.environ['PYTHONPATH'] = python_path # Set the modified PYTHONPATH in the system environment python_path = os.environ.get('PYTHONPATH', '') else: model_deploys[model.name] = { "path": model.get_local_prefix(), "placement": model.get_placement(), "kwargs": model.kwargs } if len(model_deploys) > 0: os.environ['MODEL_DOWNLOADS'] = json.dumps(model_deploys) logger.info("All Done!") return svc_config, True except Exception as e: import traceback traceback.print_exc() logger.error(e) return None, False if __name__ == "__main__": # pre-downloads the models from svc parser = argparse.ArgumentParser(description='bootstrapper for RedServing System') parser.add_argument('--svc_config_path', type=str, default = None) parser.add_argument('--sys_config_path', type=str, default = None) parser.add_argument('--apollo_id',type=str,default=None) parser.add_argument('--apollo_cluster',type=str,default=None) parser.add_argument('--apollo_ns',type=str,default=None) parser.add_argument('--apollo_env',type=str,default=None) parser.add_argument('--apollo_svc',type=str,default=None) parser.add_argument('--apollo_sys',type=str,default=None) parser.add_argument('--model_preload',type=bool,default=False) svc_args, unknown = parser.parse_known_args() if parse_svc_and_download(svc_args): sys.exit(0) sys.exit(-1) ===== /workspace/red_serving_py_plugins/resources/base_inference.py ===== ## MediaIDL from concurrent.futures import ThreadPoolExecutor from aimedia.modelinterface.ttypes import * from infra.rpc.base.ttypes import Result import red_serving_def from red_serving_common import BasicInference, RequestSession, red_serving_tool, BatchingRequestType from red_serving_tool import RedServingResponseHelper, RedServingRequestHelper import inspect import traceback import json import asyncio import time RpcResourceRequestType = "rpc-resource-query" RpcBizRequestType = "rpc-biz-query" MqType = "mq-msg" HttpRequestType = "http-resource-query" class FeatureData(object): """ 用来描述featureData,使用@AsyncDecorator返回时自动判断是否为FeatureData类型。 如果是FeatureData类型,自动构造 ResourceResponse( result=Result(success=True, code=0, message="success"), featureData= object ) """ def __init__(self, *args, **kwargs): self.dict = dict(*args, **kwargs) def __getitem__(self, key): return self.dict[key] def __setitem__(self, key, value): self.dict[key] = value def __delitem__(self, key): del self.dict[key] def __iter__(self): return iter(self.dict) def __len__(self): return len(self.dict) def __repr__(self): return repr(self.dict) def __dict__(self): return self.dict class AsyncSession(RequestSession): """ 异步请求Session包装类。 该类作为异步请求会话的包装器,通过统一的接口来处理不同类型的请求。 """ def __init__(self, base: BasicInference, infer_param_list, callback) -> None: super().__init__() self.reset(infer_param_list) self.__base = base self.__callback = callback if base.executor is None: base.executor = ThreadPoolExecutor() self.__executor = base.executor def get_base(self): return self.__base def get_callback(self): return self.__callback def is_rpc_request(self): return self.req_helper.get_req_type() == RpcResourceRequestType def is_http_request(self): return self.req_helper.get_req_type() == HttpRequestType def get_mq_msg_with_group(self): if self.req_helper.get_req_type() == MqType: request_param = self.req_helper.RpcMqRequestHelper.request_param input_map = request_param.input_map() mq_msg = request_param.input_bytes() mq_topic_name = input_map["topic"] mq_group_name = input_map["group"] mq_tag = input_map["tags"] return mq_msg, (mq_topic_name, mq_group_name, mq_tag) return None def get_raw_request(self): resource_req, mq_msg = None, None try: if self.req_helper.get_req_type() == RpcResourceRequestType: resource_req = red_serving_def.DeserializeThrift(self.req_helper.get_raw_input(), ResourceRequest) elif self.req_helper.get_req_type() == RpcBizRequestType: self.logger.warning("BizQuery Not Implemented!") return resource_req, mq_msg elif self.req_helper.get_req_type() == MqType: mq_msg = self.get_mq_msg_with_group() elif self.req_helper.get_req_type() == HttpRequestType: resource_req = self.req_helper.get_raw_input() else: self.logger.warning("unknown request type, treat as resourceQuery by default") resource_req = red_serving_def.DeserializeThrift(self.req_helper.get_raw_input(), ResourceRequest) except: self.logger.error(traceback.format_exc()) return resource_req, mq_msg def get_rpc_resource_request(self): resource_req, _ = self.get_raw_request() return resource_req def __getattr__(self, __name: str): return self.__base.__getattribute__(__name) def is_canceled(self): return self.__callback.is_canceled() def stream(self, value): res = self.__callback.stream(value) return res def stream_start(self, input_str = None): res_helper = red_serving_tool.RedServingResponseHelper() res_helper.reset(self.trace_id) if input_str: res_helper.set_string_data(input_str) # 返回boolean值,表示流发送是否成功 return self.stream(res_helper.generate_response_and_return()) def stream_end(self): """ 流式处理结束时, 根据 "StreamRes" 字段 调用相应的回调函数函数处理结果 https://code.devops.xiaohongshu.com/red-serving/red-inference-engine/-/blob/merge_async/src/servers/rpc_server_impl.cc """ self.res_helper.input_map['StreamRes'] = '1' return self.__callback(self.res_helper.generate_response_and_return()) async def stream_async(self, value): """ 通过异步执行器执行回调的流方法,暂未使用 """ loop = asyncio.get_running_loop() res = await loop.run_in_executor(self.__executor, self.__callback.stream, value) return res async def remote_call(self, node_name: str, func_name: str, res_helper: RedServingResponseHelper) -> RedServingRequestHelper: """ 执行异步远程调用,暂未使用 """ start = time.time() req_type = self.req_helper.get_req_type() if req_type: res_helper.input_map[red_serving_def.DefaultRequestTypePrefix] = req_type res_helper.input_map[red_serving_def.DefaultRemoteCallPrefix] = func_name res_list = res_helper.generate_response_and_return() elapse_args = (time.time() - start) * 1000 start = time.time() loop = asyncio.get_running_loop() response = await loop.run_in_executor(self.__executor, self.__callback.remote_call, node_name, res_list) elapse_call = (time.time() - start) * 1000 self.logger.info(f"RemoteCall(node=`{node_name}`, func=`{func_name}`) elapse_args: {elapse_args:.2f}, elapse_call: {elapse_call:.2f}ms") req_helper = red_serving_tool.RedServingRequestHelper() req_helper.reset(response) return req_helper def handle_result(session: RequestSession, res): """ 处理从异步会话中返回的结果,并根据不同的类型构造相应的(RPC/HTTP)响应 """ req_type = session.req_helper.get_req_type() is_http_request = session.is_http_request() # 如果返回结果为`(type, bool)` 的二元tuple, 第二个bool值如果为True就会terminate terminate = False if isinstance(res, tuple) and len(res) == 2: terminate = bool(res[1]) res = res[0] if is_http_request: try: if isinstance(res, str) or isinstance(res, bytes): session.res_helper.rpc_response = res elif isinstance(res, list): if len(res) > 0 and isinstance(res[0], red_serving_tool.InferParameter): session.logger.info("return generate_response_and_return") return res else: session.res_helper.append_tensors(res) return session.res_helper.generate_response_and_return(terminate=terminate) else: session.res_helper.rpc_response = f"{json.dumps(res, ensure_ascii=False)}\n" if req_type: session.res_helper.input_map[red_serving_def.DefaultRequestTypePrefix] = req_type return session.res_helper.generate_response_and_return(terminate=terminate) except Exception as e: session.res_helper.set_http_response({"success": False, "code": -1, "message": f'error: {traceback.format_exc()}'}) return session.res_helper.generate_response_and_return(terminate=True) # 自动根据返回结果类型生成rpc请求 if isinstance(res, dict): for (key, value) in res.items(): session.res_helper.add_infer_tensor(value, name=key) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, list): if len(res) > 0 and isinstance(res[0], red_serving_tool.InferParameter): session.logger.info("return generate_response_and_return") return res else: session.res_helper.append_tensors(res) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, ResourceResponse): session.res_helper.set_rpc_response(res) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, Result): session.res_helper.set_rpc_response(ResourceResponse(result=res)) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, ResourceResult): message = ModelStatus._VALUES_TO_NAMES[res.modelStatus] if res.modelStatus >= ModelStatus.ERROR_UKNOWN or res.modelStatus == res.modelStatus == ModelStatus.FAIL: success = False result = Result(success=success, code=res.modelStatus, message=message) session.res_helper.set_rpc_response(ResourceResponse(result=result, resourceResult=res)) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, ModelResultInfo): session.res_helper.set_rpc_response(ResourceResponse( result=Result(success=True, code=ModelStatus.SUCCEED_NORMAL, message="success"), resourceResult=ResourceResult(modelStatus=ModelStatus.SUCCEED_NORMAL, modelResult=res))) return session.res_helper.generate_response_and_return(terminate=terminate) elif isinstance(res, FeatureData): session.res_helper.set_rpc_response(ResourceResponse( result=Result(success=True, code=ModelStatus.SUCCEED_NORMAL, message="success"), featureData=res.__dict__())) return session.res_helper.generate_response_and_return(terminate=terminate) else: raise Exception("Unkown return type") def AsyncDecorator(func): """ BaseInference.reset_helper的异步版本,可以将self.get_raw_request()自动装载进装饰的函数中。 1:如果函数有可变参数(*inputs), 会自动将输入的tensor装载进可变参数中。 2:如果函数中有字典可变参数(**kwargs),会自动将(tensor_name, tensor_value)装载进**kwargs中。 自动根据函数类型选择相应的包装器: 1: 当函数类型为async函数 需要确保python-node为async-mode 2: 当函数类型为async-generator函数 需要确保为流式调用 自动根据返回结果类型生成rpc请求 1:返回类型为dict 使用self.res_helper.add_infer_tensor将所有的dict对应的tensor添加 2:返回类型为ResourceResponse、ResourceResult、Feature、Result 使用self.res_helper.set_rpc_response生成rpc请求 3:返回类型为二元Tuple,第二个bool如果为True那就terminate .. code-block:: python # async-mode @AsyncDecorator async def stream(self, request): prompt = request.requestData['prompt'] response = await self.model(prompt) return Result(success=True, code=1, message=f'output: {response}') .. code-block:: python # streaming @AsyncDecorator async def stream(self, request): for i in range(10): yield f"this is hello from {i}\n\n" """ spec = inspect.getfullargspec(func) is_async = inspect.iscoroutinefunction(func) is_async_gen = inspect.isasyncgenfunction(func) assert(is_async or is_async_gen, "AsyncDecorator should be apply to coroutinefunction or asyncgenfunction") if is_async_gen: # Streaming async def wrapper(self, request_list, callback): session = AsyncSession(self, request_list, callback) # self.logger.info(f"call async-generator func: {session.trace_id}") try: args = [] kwargs = {} args_len = len(spec.args) if args_len == 2 or args_len == 3: # (self, resource_req) # (self, resource_req, mq_msg) raw_request = session.get_raw_request() args = [*raw_request[0: args_len - 1]] if spec.varargs is not None: args = args + session.req_helper.get_input_tensors() if spec.varkw is not None: kwargs = session.req_helper.get_input_tensors_as_dict() session.stream_start() res = func(session, *args, **kwargs) async for result in res: session.stream(result) session.stream_end() except Exception as e: # 拦截异常, 终止rpc调用 self.logger.error(traceback.format_exc()) return wrapper if is_async: async def async_wrapper(self: RequestSession, request_list, callback): session = AsyncSession(self, request_list, callback) is_http_request = session.is_http_request() # self.logger.info(f"call async func: {session.trace_id}, is_http_request: {is_http_request}") try: args = [] kwargs = {} args_len = len(spec.args) if args_len == 2 or args_len == 3: # (self, resource_req) # (self, resource_req, mq_msg) raw_request = session.get_raw_request() args = [*raw_request[0: args_len - 1]] if spec.varargs is not None: args = args + session.req_helper.get_input_tensors() if spec.varkw is not None: kwargs = session.req_helper.get_input_tensors_as_dict() res = await func(session, *args, **kwargs) if res is not None: callback(handle_result(session, res)) except Exception as e: # 拦截异常, 终止rpc调用 self.logger.error(traceback.format_exc()) if is_http_request: session.res_helper.set_http_response({"success": False, "code": -1, "message": f'error: {traceback.format_exc()}'}) else: response = ResourceResponse(Result(success=False, code=-1, message=f'error: {traceback.format_exc()}')) session.res_helper.set_rpc_response(response) callback(session.res_helper.generate_response_and_return(terminate=True)) return async_wrapper return wrapper class BaseInference(BasicInference): def __init__(self): super().__init__() def set_init_args(self, args): self.args = args def is_rpc_request(self): return self.req_helper.get_req_type() == RpcResourceRequestType def is_http_request(self): return self.req_helper.get_req_type() == HttpRequestType def get_mq_msg_with_group(self): if self.req_helper.get_req_type() == MqType: request_param = self.req_helper.RpcMqRequestHelper.request_param input_map = request_param.input_map() mq_msg = request_param.input_bytes() mq_topic_name = input_map["topic"] mq_group_name = input_map["group"] mq_tag = input_map["tags"] return mq_msg, (mq_topic_name, mq_group_name, mq_tag) return None def get_raw_request(self, ): resource_req, mq_msg = None, None try: if self.req_helper.get_req_type() == BatchingRequestType: resource_req = self.req_helper.get_raw_input() elif self.req_helper.get_req_type() == RpcResourceRequestType: resource_req = red_serving_def.DeserializeThrift(self.req_helper.get_raw_input(), ResourceRequest) elif self.req_helper.get_req_type() == RpcBizRequestType: self.logger.warning("BizQuery Not Implemented!") return resource_req, mq_msg elif self.req_helper.get_req_type() == MqType: mq_msg = self.req_helper.get_raw_input() elif self.req_helper.get_req_type() == HttpRequestType: resource_req = self.req_helper.get_raw_input() else: self.logger.warning("unknown request type, treat as resourceQuery by default") resource_req = red_serving_def.DeserializeThrift(self.req_helper.get_raw_input(), ResourceRequest) except: self.logger.error(traceback.format_exc()) return resource_req, mq_msg def get_rpc_resource_request(self, ): resource_req, _ = self.get_raw_request() return resource_req ===== /workspace/red_serving_py_plugins/resources/red_serving_redkv.py ===== from redis import Redis, ConnectionError, TimeoutError import traceback from edsredis import EdsBlockingConnectionPool from loguru import logger import os from typing import Optional _redis_client = None def get_address() : if os.environ.get('KUBERNETES_SERVICE_PORT') is not None : return '127.0.0.1' # servicemesh else : # virtual machine return '10.0.249.240' def get_redis_client(): global _redis_client if _redis_client == None: try: cache_service = os.environ.get("CACHE_SERVICE", "") if cache_service != "": eds_connection_pool = EdsBlockingConnectionPool(cluster_name=cache_service) _redis_client = Redis(connection_pool=eds_connection_pool, socket_timeout=5.0, socket_connect_timeout=5.0, retry_on_timeout=True, decode_responses=False) else: _redis_client = Redis(host = get_address(), port=os.environ.get("CACHE_PORT", 20320), socket_timeout=5.0, socket_connect_timeout=5.0, retry_on_timeout=True, decode_responses=False) except: logger.error(traceback.format_exc()) return _redis_client def load_image_from_redis_cache(image_url: str) -> Optional[bytes]: if not isinstance(image_url, str) or not image_url.strip(): raise ValueError("Image URL cannot be empty and must be a string") redis_client = get_redis_client() if redis_client is None: return None try: if not redis_client.ping(): logger.warning("Redis server did not respond to ping") return None if not redis_client.exists(image_url): logger.info(f"Image not found in cache: {image_url}") return None image_data = redis_client.get(image_url) if not image_data: logger.warning(f"Retrieved image data is empty: {image_url}") return None try: image = image_data # Verify will make image to None, and need reopen image. we just remove it here. # image.verify() return image except Exception as e: logger.error(f"Image data is invalid or corrupted: {str(e)}") return None except ConnectionError as e: logger.error(f"Redis connection error: {str(e)}") return None except TimeoutError as e: logger.error(f"Redis operation timed out: {str(e)}") return None except Exception as e: logger.error(f"Unexpected error: {str(e)}") return None ===== /workspace/red_serving_py_plugins/resources/red_serving_def.py ===== from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol DefaultCacheKeyPrefix = "red_serving_cache_" DefaultControlKeyPrefix = "red_serving_control_" DefaultRequestTypePrefix = "req_ctx_source_type_" DefaultRemoteCallPrefix = "red_serving_remote_call_" DefaultModelNameKey = "red_serving_model_key" DefaultCacheValueTypeKey = "cache_data_type" DefaultHiveRecordKey = "HiveRecord" DefaultRedKvKey = "CacheKey" DefaultRedKvValue = "CacheValue" DefaultTitanDtype = "red_serving_request_data_name_key" DefaultInferKeyPrefix = "red_serving_infer_" DefaultCacheType = 1 DefaultMaxMetricsNums=100 def SerializeThrift(th_obj): """ Serialize. """ tmembuf = TTransport.TMemoryBuffer() tbinprot = TBinaryProtocol.TBinaryProtocol(tmembuf) th_obj.write(tbinprot) return tmembuf.getvalue() def DeserializeThrift(val, th_obj_type): """ Deserialize. """ th_obj = th_obj_type() tmembuf = TTransport.TMemoryBuffer(val) tbinprot = TBinaryProtocol.TBinaryProtocol(tmembuf) th_obj.read(tbinprot) return th_obj ===== /workspace/red_serving_py_plugins/resources/redserving_user_plugin.py ===== import asyncio import copy import datetime import json import os import subprocess import time from pydantic import TypeAdapter from typing import Any, Dict, Tuple, Union from dataclasses import dataclass from pillow_heif import register_heif_opener register_heif_opener() import yaml from base_inference import AsyncDecorator, BaseInference, RpcResourceRequestType, Result # os.environ['PY_RED_SERVING_DEBUG']="TRUE" from vllm.engine.arg_utils import AsyncEngineArgs # from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.v1.engine.async_llm import AsyncLLM from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.entrypoints.openai.protocol import ChatCompletionRequest from vllm.entrypoints.openai.serving_chat import OpenAIServingChat from vllm.entrypoints.pooling.classify.protocol import ClassificationRequest from vllm.entrypoints.pooling.classify.serving import ServingClassification from vllm.entrypoints.pooling.embed.protocol import EmbeddingRequest from vllm.entrypoints.pooling.embed.serving import OpenAIServingEmbedding from vllm.entrypoints.pooling.pooling.protocol import PoolingRequest from vllm.entrypoints.pooling.pooling.serving import OpenAIServingPooling from vllm.entrypoints.pooling.score.serving import ScoreRequest, RerankRequest from vllm.entrypoints.openai.serving_models import OpenAIServingModels, BaseModelPath from vllm.outputs import RequestOutput from vllm.sampling_params import SamplingParams from vllm.utils import random_uuid from vllm.entrypoints.utils import process_chat_template from prometheus_client import start_http_server import base64 from red_serving_redkv import load_image_from_redis_cache from concurrent.futures import ThreadPoolExecutor import torch _LOCAL_LOGGING_INTERVAL_SEC = 5 @dataclass class ServingArgs: lora_modules: list = None prompt_adapters: list = None response_role:str = "assistant" chat_template = None chat_template_content_format = "auto" return_tokens_as_token_ids: bool = False enable_auto_tool_choice: bool = False tool_call_parser: str = None reasoning_parser: str = "" enable_prompt_tokens_details: bool = False trust_request_chat_template: bool = False class Plugin(BaseInference): def __init__(self) -> None: super().__init__() torch.set_num_threads(16) # speed torch cpu caculate. def create_async_engine_args( self, directory: str = "/workspace/models/", filename: str = "config.json", task: str = "generate", ) -> AsyncEngineArgs: def find_directories_with_model(directory, filename): directories = set() for root, _, filenames in os.walk(directory): if filename in filenames: directories.add(root) assert len(directories) == 1, print(f"There are {len(directories)} models") return list(directories) if directory=="/workspace/models/": model_path = find_directories_with_model(directory, filename) else: model_path = [directory] engine_args = AsyncEngineArgs(model_path[0]) engine_args.task = task engine_args.trust_remote_code = True return engine_args def set_init_args(self, args: str) -> None: start_http_server(int(os.getenv("ADD_METRICS_PORT","9999"))) # config from config.yaml vllm_use_v1 = os.environ.get('VLLM_USE_V1') self.logger.info(f"vllm_use_v1: {vllm_use_v1}") self.config_args = yaml.safe_load(args) serving_args = ServingArgs() # default config if "model" in self.config_args: self.engine_args = self.create_async_engine_args( directory=self.config_args["model"], task=self.config_args.get("task", "generate") ) else: self.logger.info("Don't find model_path in svc config. Use default model_path: /workspace/models/") self.engine_args = self.create_async_engine_args() self.task = self.config_args.get("task", "generate") # update config if "served_model_name" in self.config_args: if isinstance(self.config_args["served_model_name"], list): self.engine_args.served_model_name = self.config_args["served_model_name"] else: self.engine_args.served_model_name = [self.config_args["served_model_name"]] if "scheduler_config" in self.config_args: for key, value in self.config_args["scheduler_config"].items(): if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) else: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") for key, value in self.config_args.items(): supported = False if key in ["model", "served_model_name", "scheduler_config", "generation_config"]: continue if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) supported = True if hasattr(serving_args, key): setattr(serving_args, key, value) supported = True if not supported: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") self.logger.info(f"engine_args is: {self.engine_args}") if self.engine_args.task == "generate" and vllm_use_v1 != "0": self.engine = AsyncLLM.from_engine_args(self.engine_args) model_config = self.engine.model_config else: self.engine = AsyncLLMEngine.from_engine_args(self.engine_args) if isinstance(self.engine, AsyncLLM): model_config = self.engine.model_config # for V1 (vllm>=0.9.2) else: model_config = self.engine.engine.model_config # for V0 served_model_names = [self.engine_args.model] if self.engine_args.served_model_name is None else self.engine_args.served_model_name base_model_paths = [ BaseModelPath(name=name, model_path=self.engine_args.model) for name in served_model_names ] self.serving_model = OpenAIServingModels(self.engine, base_model_paths, lora_modules=serving_args.lora_modules) resolved_chat_template = asyncio.run(process_chat_template(serving_args.chat_template, self.engine, model_config)) self.logger.info(resolved_chat_template) if self.engine_args.task == "generate": self.adapter = TypeAdapter(ChatCompletionRequest) self.openai_serving_chat = OpenAIServingChat(self.engine, self.serving_model, response_role=serving_args.response_role, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, return_tokens_as_token_ids=serving_args.return_tokens_as_token_ids, enable_auto_tools=serving_args.enable_auto_tool_choice, tool_parser=serving_args.tool_call_parser, reasoning_parser=serving_args.reasoning_parser, enable_prompt_tokens_details=serving_args.enable_prompt_tokens_details,) elif self.engine_args.task == "embed": self.adapter = TypeAdapter(EmbeddingRequest) self.openai_serving_embedding = OpenAIServingEmbedding(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task == "score": if self.task == "score": self.adapter = TypeAdapter(ScoreRequest) elif self.task == "rerank": self.adapter = TypeAdapter(RerankRequest) self.serving_scores = ServingScores(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template,) elif self.engine_args.task == "classify": self.adapter = TypeAdapter(ClassificationRequest) self.serving_classification = ServingClassification(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task in ["token_embed", "token_classify"]: self.adapter = TypeAdapter(PoolingRequest) self.serving_pooling = ServingPooling(self.engine, self.serving_model, supported_tasks=[self.engine_args.task], request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) self.latest_request_time = int(datetime.datetime.timestamp(datetime.datetime.now())) if not self.engine_args.disable_log_stats and self.loop is not None: self.logger.info("self.loop is not None") async def _force_log(): while True: await asyncio.sleep(_LOCAL_LOGGING_INTERVAL_SEC) # if no request, report stats every 60s now = int(datetime.datetime.timestamp(datetime.datetime.now())) if now - self.latest_request_time > _LOCAL_LOGGING_INTERVAL_SEC: await self.engine.do_log_stats() asyncio.run_coroutine_threadsafe(_force_log(), self.loop) self.load_image_executor = ThreadPoolExecutor(max_workers=16) async def pre_process(self, request): request_body: Dict[str, Any] = json.loads(request) # 这段逻辑是否需要放在我们这里,还是让业务自己来维护? def parse_image_str(image_content: str) -> Tuple[bool, str, str]: # 返回是否是缓存图片,http_url, key def get_image_search_key(url: str) -> str: return url.split('/')[-1].replace('.', '-') + '-shequ-640' if 'active_search' in image_content: # 图搜的图片url前缀 return True, image_content, get_image_search_key(image_content) if image_content.startswith("imagetransfer_"): # 国内问一问的图片url前缀 return True, image_content[len("imagetransfer_"):], image_content return False, image_content, image_content if request_body.get("messages", []) == None: request_body.pop("messages", None) # 加载 RedKV 数据 for message in request_body.get("messages", []): if message["role"] == "user": if isinstance(message["content"], list): # 并行加载图片 image_tasks = [] for content in message["content"]: if content["type"] == "image_url": image_url = content["image_url"]["url"] is_cached, http_url, key = parse_image_str(image_url) if is_cached: image_tasks.append((content, key, http_url)) # 并行执行所有图片加载任务 if image_tasks: start_time = time.time() futures = [] for content, key, http_url in image_tasks: fut = asyncio.get_running_loop().run_in_executor(self.load_image_executor, load_image_from_redis_cache, key) futures.append(fut) # futures.append(.submit(load_image_from_redis_cache, key)) for (content, key, http_url), future in zip(image_tasks, futures): try: img = await future if img is not None: mime_type = 'application/octet-stream' encoded_data = base64.b64encode(img).decode('utf-8') url = f'data:{mime_type};base64,{encoded_data}' content["image_url"]["url"] = url else: content["image_url"]["url"] = http_url except Exception as e: self.logger.error(f"load image from redis cache error: {e}") content["image_url"]["url"] = http_url end_time = time.time() self.logger.info(f"parallel load {len(image_tasks)} images from redis cache time: {end_time - start_time}") else: assert isinstance(message["content"], str) return request_body async def post_process(self, result): return result.model_dump() def finish(self, msg, stream): if stream: self.stream_start() self.stream(msg) self.stream_end() else: if self.req_helper.get_req_type() == RpcResourceRequestType: result = Result() result.message = msg result.code = 0 result.success = True return result return json.dumps({"code":400, "message": msg}) @AsyncDecorator async def handle(self, request: str, mq_req: str) -> Any: # update arrival time of last request self.latest_request_time = datetime.datetime.now() # for mq topic_name = "" consumer_group_name = "" tag_name = "" if request is None: # rpc and mq request both are str and can convert to dict # only one of them is not None if isinstance(mq_req, tuple): request = mq_req[0] if len(mq_req) > 1: mq_group = mq_req[1] # (topic_name, group_name, tag_name) if isinstance(mq_group, tuple) and len(mq_group) == 3: topic_name, consumer_group_name, tag_name = mq_group else: request = mq_req elif self.req_helper.get_req_type() == RpcResourceRequestType: raw_request, _ = self.get_raw_request() request = raw_request.requestData["data"] request_body = await self.pre_process(request) stream = request_body.get("stream", False) self.logger.info(f"request: {request_body}") try: request = self.adapter.validate_python(request_body) except Exception as e: self.logger.error(e) return self.finish(str(e), stream) if self.engine_args.task == "generate": generator = self.openai_serving_chat.create_chat_completion(request) request_id = f"chatcmpl-{request.request_id}" elif self.engine_args.task == "embed": generator = self.openai_serving_embedding.create_embedding(request) request_id = "0" elif self.engine_args.task == "score": if self.task == "rerank": generator = self.serving_scores.do_rerank(request) else: generator = self.serving_scores.create_score(request) request_id = "0" elif self.engine_args.task == "classify": generator = self.serving_classification.create_classify(request, None) request_id = "0" elif self.engine_args.task in ["token_embed", "token_classify"]: generator = self.serving_pooling.create_pooling(request) request_id = f"pool-{request.request_id}" user_model_name = request.model # set request's model to served model name. request.model = self.serving_model.model_name() if stream: self.stream_start() async for output in await generator: if output.strip() != "data: [DONE]": body = json.loads(output[len("data:"):]) # self.logger.info(output) # recover user model name setting body["model"] = user_model_name output = "data: " + json.dumps(body, ensure_ascii=False) + "\n\n" if not self.stream(output): # request disconnected. await self.engine.abort(request_id) break self.stream_end() else: async def listen_disconnect(): while True: if self.is_canceled(): await self.engine.abort(request_id) return await asyncio.sleep(0.1) listen_task = asyncio.create_task(listen_disconnect()) gen_task = asyncio.create_task(generator) final_res = await gen_task # recover user model name setting final_res.model = user_model_name listen_task.cancel() response = await self.post_process(final_res) if self.req_helper.get_req_type() == RpcResourceRequestType: result = Result() result.message = json.dumps( response, ensure_ascii=False, ) result.code = 0 result.success = True return result return response ===== /workspace/red_serving_py_plugins/resources/ci_test/offline_batching_test.py ===== import os import psutil import signal import select import subprocess import time import pytest os.environ['https_proxy'] = '10.7.4.2:3128' os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' os.environ["CUDA_VISIBLE_DEVICES"] = "1" # 定义清理操作 def cleanup(): # 过滤并终止指定的进程 for proc in psutil.process_iter(['pid', 'name', 'cmdline']): try: if any(key in proc.info['name'] for key in ['python3', 'stub', 'red_serving']): print(f"Killing process {proc.info['pid']} ({proc.info['cmdline']})") if psutil.pid_exists(proc.info['pid']): os.kill(proc.info['pid'], 9) except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): pass # 信号处理函数 def signal_handler(signum, frame): print("\nCaught Ctrl+C! Cleaning up...") cleanup() # 退出程序 pytest.exit("Exit after cleanup", returncode=0) # 注册 SIGINT 信号处理 signal.signal(signal.SIGINT, signal_handler) def check_ready(process, ready_str="all node ready", timeout=300): """检查run.sh进程日志中是否包含'all node ready',并设置超时""" start_time = time.time() while True: # 检查超时 if time.time() - start_time > timeout: print("Timeout reached: 'all node ready' was not detected within the timeout period.") return False # 使用select来非阻塞检查输出 ready, _, _ = select.select([process.stdout], [], [], 1) # 设置 1 秒的超时 if ready: line = process.stdout.readline() print(f"log is {line}") if ready_str in line: return True # 检查进程是否已意外退出 if process.poll() is not None: return False def check_success(process, timeout=10): """检查 run.sh 进程日志中是否包含 'success=1' 或 'success=0',并设置超时""" start_time = time.time() for line in iter(process.stdout.readline, ''): print(f"log is {line.strip()}") if 'success=1' in line: return True if 'success=0' in line: return False # 检查超时 if time.time() - start_time > timeout: print("Timeout reached: 'success' was not detected within the timeout period.") return False if process.poll() is not None: return False def test_offline_batch_llm(): cleanup() # 启动 run.sh,传入自定义的 svc_config_path cmd = [ 'bash', '/workspace/run.sh', '--svc_config_path=/workspace/red_serving_py_plugins/resources/ci_test/svc_llm.yaml', '--offline_batching' ] process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1,universal_newlines=True) # 等待 'Ray process completed successfully',超时时间设置为 1000 秒 assert check_ready(process, ready_str="Ray process completed successfully", timeout=1000), "Failed to detect 'Ray process completed successfully' within 1000s." # 杀掉所有运行中的run.sh进程 cleanup() def test_offline_batch_vlm(): cleanup() # 启动 run.sh,传入自定义的 svc_config_path cmd = [ 'bash', '/workspace/run.sh', '--svc_config_path=/workspace/red_serving_py_plugins/resources/ci_test/svc_vlm.yaml', '--offline_batching' ] process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1,universal_newlines=True) # 等待 'Ray process completed successfully',超时时间设置为 1000 秒 assert check_ready(process, ready_str="Ray process completed successfully", timeout=1000), "Failed to detect 'Ray process completed successfully' within 1000s." # 杀掉所有运行中的run.sh进程 cleanup() def test_offline_batch_lora(): cleanup() # 启动 run.sh,传入自定义的 svc_config_path cmd = [ 'bash', '/workspace/run.sh', '--svc_config_path=/workspace/red_serving_py_plugins/resources/ci_test/svc_lora.yaml', '--offline_batching' ] process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1,universal_newlines=True) # 等待 'Ray process completed successfully',超时时间设置为 1000 秒 assert check_ready(process, ready_str="Ray process completed successfully", timeout=1000), "Failed to detect 'Ray process completed successfully' within 1000s." # 杀掉所有运行中的run.sh进程 cleanup() ===== /workspace/red_serving_py_plugins/resources/red_serving_tool_debug.py ===== # -*- coding: utf-8 -*- import json import numpy as np import pickle import red_serving_def import red_serving_tool from py_infer_params import PyInferParameter as InferParameter from py_infer_params import PyTensor class PyRemoteInferPlugin(object): infer_core = None def __init__(self, infer_core = None): self.infer_core = infer_core def set(self, call_obj): pass def call(self, trace_id, model_name, inputs): return self.infer_core.infer(trace_id, model_name, inputs) class RedServingRequestHelper(red_serving_tool.RedServingRequestHelper): def __init__(self): super().__init__() class RedServingResponseHelper(red_serving_tool.RedServingResponseHelper): def __init__(self): super().__init__() def add_infer_tensor(self, tensor, name=""): if isinstance(tensor, (np.ndarray, np.generic)): if len(name) == 0: name = "INPUT__" + str(self.input_tensor_idx) self.input_tensor_idx = self.input_tensor_idx+1 self.append_tensors(PyTensor(name, tensor)) return True else: print("input tensor must by numpy array") return False def add_user_cache(self, cache_key, cache_value): ## TODO 判断重名 cache_key = red_serving_def.DefaultCacheKeyPrefix + cache_key if isinstance(cache_value, np.ndarray): t = PyTensor(cache_key, cache_value) input_map = {} input_map[red_serving_def.DefaultCacheValueTypeKey] = "numpy" cache_param = InferParameter(self.trace_id, "", input_map, [t]) cache_param.set_name_and_type(cache_key, 1) self.res_params.append(cache_param) elif isinstance(cache_value, (tuple,list,dict)): input_map = {} cached_str = None input_map[red_serving_def.DefaultCacheValueTypeKey] = "json" if isinstance(cache_value, (tuple, list)): for item in cache_value: if isinstance(item, (bytes, float, int, str)) is not True: input_map[red_serving_def.DefaultCacheValueTypeKey] = "pickle" else: for k, v in cache_value.items(): if isinstance(k, (float,int,str,bytes)) is not True or isinstance(v, (bytes,float, int, str)) is not True: input_map[red_serving_def.DefaultCacheValueTypeKey] = "pickle" if input_map[red_serving_def.DefaultCacheValueTypeKey] == "json": cached_str = json.dumps(cache_value) else: cached_str = pickle.dumps(cache_value) cache_param = InferParameter(self.trace_id, cached_str, input_map, []) cache_param.set_name_and_type(cache_key, red_serving_def.DefaultCacheType) self.res_params.append(cache_param) elif isinstance(cache_value, (str, bytes)): input_map = {} if isinstance(cache_value, str): input_map[red_serving_def.DefaultCacheValueTypeKey] = 'str' else: input_map[red_serving_def.DefaultCacheValueTypeKey] = 'bytes' cache_param = InferParameter(self.trace_id, cache_value, input_map, []) cache_param.set_name_and_type(cache_key, 1) self.res_params.append(cache_param) else: print("not supported value type, cache_value:{} type:{}".format(cache_value, type(cache_value))) return False return True def generate_serving_param(self, trace_id="0", terminate=False): if terminate is True: self.input_map[red_serving_def.DefaultControlKeyPrefix+"terminate_workflow"] = 'True' return InferParameter(trace_id=trace_id, input_string=self.input_string, input_map=self.input_map, input_tensors=self.input_tensors) def generate_response_and_return(self, terminate = False): param = self.generate_serving_param(terminate = terminate) if self.rpc_response is not None: param.attach_rpc_res(self.rpc_response) return self.generate_response(param) ===== /workspace/red_serving_py_plugins/resources/redserving_vllm_plugin.py ===== import asyncio import copy import datetime import json import os import subprocess import time from pydantic import TypeAdapter from typing import Any, Dict, Tuple, Union from dataclasses import dataclass from pillow_heif import register_heif_opener register_heif_opener() import yaml from base_inference import AsyncDecorator, BaseInference, RpcResourceRequestType, Result # os.environ['PY_RED_SERVING_DEBUG']="TRUE" from vllm.engine.arg_utils import AsyncEngineArgs # from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.v1.engine.async_llm import AsyncLLM from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.entrypoints.openai.protocol import ChatCompletionRequest from vllm.entrypoints.openai.serving_chat import OpenAIServingChat from vllm.entrypoints.pooling.classify.protocol import ClassificationRequest from vllm.entrypoints.pooling.classify.serving import ServingClassification from vllm.entrypoints.pooling.embed.protocol import EmbeddingRequest from vllm.entrypoints.pooling.embed.serving import OpenAIServingEmbedding from vllm.entrypoints.pooling.pooling.protocol import PoolingRequest from vllm.entrypoints.pooling.pooling.serving import OpenAIServingPooling from vllm.entrypoints.pooling.score.serving import ScoreRequest, RerankRequest from vllm.entrypoints.openai.serving_models import OpenAIServingModels, BaseModelPath from vllm.outputs import RequestOutput from vllm.sampling_params import SamplingParams from vllm.utils import random_uuid from vllm.entrypoints.utils import process_chat_template from prometheus_client import start_http_server import base64 from red_serving_redkv import load_image_from_redis_cache from concurrent.futures import ThreadPoolExecutor import torch _LOCAL_LOGGING_INTERVAL_SEC = 5 @dataclass class ServingArgs: lora_modules: list = None prompt_adapters: list = None response_role:str = "assistant" chat_template = None chat_template_content_format = "auto" return_tokens_as_token_ids: bool = False enable_auto_tool_choice: bool = False tool_call_parser: str = None reasoning_parser: str = "" enable_prompt_tokens_details: bool = False trust_request_chat_template: bool = False class Plugin(BaseInference): def __init__(self) -> None: super().__init__() torch.set_num_threads(16) # speed torch cpu caculate. def create_async_engine_args( self, directory: str = "/workspace/models/", filename: str = "config.json", task: str = "generate", ) -> AsyncEngineArgs: def find_directories_with_model(directory, filename): directories = set() for root, _, filenames in os.walk(directory): if filename in filenames: directories.add(root) assert len(directories) == 1, print(f"There are {len(directories)} models") return list(directories) if directory=="/workspace/models/": model_path = find_directories_with_model(directory, filename) else: model_path = [directory] engine_args = AsyncEngineArgs(model_path[0]) engine_args.task = task engine_args.trust_remote_code = True return engine_args def set_init_args(self, args: str) -> None: start_http_server(int(os.getenv("ADD_METRICS_PORT","9999"))) # config from config.yaml vllm_use_v1 = os.environ.get('VLLM_USE_V1') self.logger.info(f"vllm_use_v1: {vllm_use_v1}") self.config_args = yaml.safe_load(args) serving_args = ServingArgs() # default config if "model" in self.config_args: self.engine_args = self.create_async_engine_args( directory=self.config_args["model"], task=self.config_args.get("task", "generate") ) else: self.logger.info("Don't find model_path in svc config. Use default model_path: /workspace/models/") self.engine_args = self.create_async_engine_args() self.task = self.config_args.get("task", "generate") # update config if "served_model_name" in self.config_args: if isinstance(self.config_args["served_model_name"], list): self.engine_args.served_model_name = self.config_args["served_model_name"] else: self.engine_args.served_model_name = [self.config_args["served_model_name"]] if "scheduler_config" in self.config_args: for key, value in self.config_args["scheduler_config"].items(): if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) else: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") for key, value in self.config_args.items(): supported = False if key in ["model", "served_model_name", "scheduler_config", "generation_config"]: continue if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) supported = True if hasattr(serving_args, key): setattr(serving_args, key, value) supported = True if not supported: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") self.logger.info(f"engine_args is: {self.engine_args}") if self.engine_args.task == "generate" and vllm_use_v1 != "0": self.engine = AsyncLLM.from_engine_args(self.engine_args) model_config = self.engine.model_config else: self.engine = AsyncLLMEngine.from_engine_args(self.engine_args) if isinstance(self.engine, AsyncLLM): model_config = self.engine.model_config # for V1 (vllm>=0.9.2) else: model_config = self.engine.engine.model_config # for V0 served_model_names = [self.engine_args.model] if self.engine_args.served_model_name is None else self.engine_args.served_model_name base_model_paths = [ BaseModelPath(name=name, model_path=self.engine_args.model) for name in served_model_names ] self.serving_model = OpenAIServingModels(self.engine, base_model_paths, lora_modules=serving_args.lora_modules) resolved_chat_template = asyncio.run(process_chat_template(serving_args.chat_template, self.engine, model_config)) self.logger.info(resolved_chat_template) if self.engine_args.task == "generate": self.adapter = TypeAdapter(ChatCompletionRequest) self.openai_serving_chat = OpenAIServingChat(self.engine, self.serving_model, response_role=serving_args.response_role, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, return_tokens_as_token_ids=serving_args.return_tokens_as_token_ids, enable_auto_tools=serving_args.enable_auto_tool_choice, tool_parser=serving_args.tool_call_parser, reasoning_parser=serving_args.reasoning_parser, enable_prompt_tokens_details=serving_args.enable_prompt_tokens_details,) elif self.engine_args.task == "embed": self.adapter = TypeAdapter(EmbeddingRequest) self.openai_serving_embedding = OpenAIServingEmbedding(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task == "score": if self.task == "score": self.adapter = TypeAdapter(ScoreRequest) elif self.task == "rerank": self.adapter = TypeAdapter(RerankRequest) self.serving_scores = ServingScores(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template,) elif self.engine_args.task == "classify": self.adapter = TypeAdapter(ClassificationRequest) self.serving_classification = ServingClassification(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task in ["token_embed", "token_classify"]: self.adapter = TypeAdapter(PoolingRequest) self.serving_pooling = ServingPooling(self.engine, self.serving_model, supported_tasks=[self.engine_args.task], request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) self.latest_request_time = int(datetime.datetime.timestamp(datetime.datetime.now())) if not self.engine_args.disable_log_stats and self.loop is not None: self.logger.info("self.loop is not None") async def _force_log(): while True: await asyncio.sleep(_LOCAL_LOGGING_INTERVAL_SEC) # if no request, report stats every 60s now = int(datetime.datetime.timestamp(datetime.datetime.now())) if now - self.latest_request_time > _LOCAL_LOGGING_INTERVAL_SEC: await self.engine.do_log_stats() asyncio.run_coroutine_threadsafe(_force_log(), self.loop) self.load_image_executor = ThreadPoolExecutor(max_workers=16) async def pre_process(self, request): request_body: Dict[str, Any] = json.loads(request) # 这段逻辑是否需要放在我们这里,还是让业务自己来维护? def parse_image_str(image_content: str) -> Tuple[bool, str, str]: # 返回是否是缓存图片,http_url, key def get_image_search_key(url: str) -> str: return url.split('/')[-1].replace('.', '-') + '-shequ-640' if 'active_search' in image_content: # 图搜的图片url前缀 return True, image_content, get_image_search_key(image_content) if image_content.startswith("imagetransfer_"): # 国内问一问的图片url前缀 return True, image_content[len("imagetransfer_"):], image_content return False, image_content, image_content if request_body.get("messages", []) == None: request_body.pop("messages", None) # 加载 RedKV 数据 for message in request_body.get("messages", []): if message["role"] == "user": if isinstance(message["content"], list): # 并行加载图片 image_tasks = [] for content in message["content"]: if content["type"] == "image_url": image_url = content["image_url"]["url"] is_cached, http_url, key = parse_image_str(image_url) if is_cached: image_tasks.append((content, key, http_url)) # 并行执行所有图片加载任务 if image_tasks: start_time = time.time() futures = [] for content, key, http_url in image_tasks: fut = asyncio.get_running_loop().run_in_executor(self.load_image_executor, load_image_from_redis_cache, key) futures.append(fut) # futures.append(.submit(load_image_from_redis_cache, key)) for (content, key, http_url), future in zip(image_tasks, futures): try: img = await future if img is not None: mime_type = 'application/octet-stream' encoded_data = base64.b64encode(img).decode('utf-8') url = f'data:{mime_type};base64,{encoded_data}' content["image_url"]["url"] = url else: content["image_url"]["url"] = http_url except Exception as e: self.logger.error(f"load image from redis cache error: {e}") content["image_url"]["url"] = http_url end_time = time.time() self.logger.info(f"parallel load {len(image_tasks)} images from redis cache time: {end_time - start_time}") else: assert isinstance(message["content"], str) return request_body async def post_process(self, result): return result.model_dump() def finish(self, msg, stream): if stream: self.stream_start() self.stream(msg) self.stream_end() else: if self.req_helper.get_req_type() == RpcResourceRequestType: result = Result() result.message = msg result.code = 0 result.success = True return result return json.dumps({"code":400, "message": msg}) @AsyncDecorator async def handle(self, request: str, mq_req: str) -> Any: # update arrival time of last request self.latest_request_time = datetime.datetime.now() # for mq topic_name = "" consumer_group_name = "" tag_name = "" if request is None: # rpc and mq request both are str and can convert to dict # only one of them is not None if isinstance(mq_req, tuple): request = mq_req[0] if len(mq_req) > 1: mq_group = mq_req[1] # (topic_name, group_name, tag_name) if isinstance(mq_group, tuple) and len(mq_group) == 3: topic_name, consumer_group_name, tag_name = mq_group else: request = mq_req elif self.req_helper.get_req_type() == RpcResourceRequestType: raw_request, _ = self.get_raw_request() request = raw_request.requestData["data"] request_body = await self.pre_process(request) stream = request_body.get("stream", False) self.logger.info(f"request: {request_body}") try: request = self.adapter.validate_python(request_body) except Exception as e: self.logger.error(e) return self.finish(str(e), stream) if self.engine_args.task == "generate": generator = self.openai_serving_chat.create_chat_completion(request) request_id = f"chatcmpl-{request.request_id}" elif self.engine_args.task == "embed": generator = self.openai_serving_embedding.create_embedding(request) request_id = "0" elif self.engine_args.task == "score": if self.task == "rerank": generator = self.serving_scores.do_rerank(request) else: generator = self.serving_scores.create_score(request) request_id = "0" elif self.engine_args.task == "classify": generator = self.serving_classification.create_classify(request, None) request_id = "0" elif self.engine_args.task in ["token_embed", "token_classify"]: generator = self.serving_pooling.create_pooling(request) request_id = f"pool-{request.request_id}" user_model_name = request.model # set request's model to served model name. request.model = self.serving_model.model_name() if stream: self.stream_start() async for output in await generator: if output.strip() != "data: [DONE]": body = json.loads(output[len("data:"):]) # self.logger.info(output) # recover user model name setting body["model"] = user_model_name output = "data: " + json.dumps(body, ensure_ascii=False) + "\n\n" if not self.stream(output): # request disconnected. await self.engine.abort(request_id) break self.stream_end() else: async def listen_disconnect(): while True: if self.is_canceled(): await self.engine.abort(request_id) return await asyncio.sleep(0.1) listen_task = asyncio.create_task(listen_disconnect()) gen_task = asyncio.create_task(generator) final_res = await gen_task # recover user model name setting final_res.model = user_model_name listen_task.cancel() response = await self.post_process(final_res) if self.req_helper.get_req_type() == RpcResourceRequestType: result = Result() result.message = json.dumps( response, ensure_ascii=False, ) result.code = 0 result.success = True return result return response ===== /workspace/red_serving_py_plugins/resources/py_red_serving_test_cases.py ===== from base_media_inference import BaseMediaInference from aimedia.modelinterface.ttypes import FeatureType if __name__ == "__main__": class TestData(object): def __init__(self, stringListValue=[], featureData=None, requestData={}): self.type = FeatureType.STRING_LIST self.stringListValue = stringListValue self.featureData=featureData self.requestData=requestData base_media_inference = BaseMediaInference() print("##### test cache case #####") # cache key is temporary. Please update it when testing cache_data = TestData(stringListValue=["110/3/01e3c25d2b430ef40390000985af3bf788_105.jpg", "110/3/01e3c25d1c4304430390000985af3bea79_240.jpg"]) featureData = {"resourceCacheKeys": cache_data} img_bin = base_media_inference.get_img_from_featuredata(featureData) if img_bin is None or (isinstance(img_bin, list) and None in img_bin): print("cache_data test Failed!, cache_data.stringListValue: {}. Please check cache_key is valid or not!".format(cache_data.stringListValue)) else: print("cache_data test Success!") print("##### test urls case #####") image_urls = TestData(stringListValue=["http://ci.xiaohongshu.com/0102840155cn5irfzym0117udc123c3yiy", "http://ci.xiaohongshu.com/0102840155cn5irfzym0117udc14wizek3"]) featureData = {"imageUrls": image_urls} img_bin = base_media_inference.get_img_from_featuredata(featureData) if img_bin is None or (isinstance(img_bin, list) and None in img_bin): print("imageUrls test Failed!, urls: {}".format(image_urls.stringListValue)) else: print("imageUrls test Success!") print("##### test featureData #####") request = TestData(featureData=featureData) img_bin = base_media_inference.get_img(request=request) if img_bin is None or (isinstance(img_bin, list) and None in img_bin): print("get_img interface test featureData Failed!, request.featureData: {}".format(request.featureData)) else: print("get_img interface test featureData Success!") print("##### test img_url #####") request = TestData(requestData={"img_url": "http://ci.xiaohongshu.com/0102840155cn5irfzym0117udc14wizek3"}) img_bin = base_media_inference.get_img(request=request) if img_bin is None or (isinstance(img_bin, list) and None in img_bin): print("get_img interface test img_url Failed!, request.requestData: {}".format(request.requestData)) else: print("get_img interface test img_url Success!") ===== /workspace/red_serving_py_plugins/resources/modelscheduler_vllm_rpc.py ===== import asyncio import copy import datetime import json import os import subprocess import time from typing import Any, Dict, Tuple from dataclasses import dataclass from pillow_heif import register_heif_opener register_heif_opener() import yaml from pydantic import TypeAdapter from typing import Any, Dict, Tuple, Union from aimedia.modelinterface.ttypes import ResourceRequest, ResourceResponse, ModelStatus, ModelResultInfo, LabelInfo, ResourceResult, Feature, FeatureType, LabelResponse from base_inference import AsyncDecorator, BaseInference, RpcResourceRequestType, Result # os.environ['PY_RED_SERVING_DEBUG']="TRUE" from vllm.engine.arg_utils import AsyncEngineArgs # from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.v1.engine.async_llm import AsyncLLM from vllm.engine.async_llm_engine import AsyncLLMEngine from vllm.entrypoints.openai.protocol import ChatCompletionRequest from vllm.entrypoints.openai.serving_chat import OpenAIServingChat from vllm.entrypoints.pooling.classify.protocol import ClassificationRequest from vllm.entrypoints.pooling.classify.serving import ServingClassification from vllm.entrypoints.pooling.embed.protocol import EmbeddingRequest from vllm.entrypoints.pooling.embed.serving import OpenAIServingEmbedding from vllm.entrypoints.pooling.pooling.protocol import PoolingRequest from vllm.entrypoints.pooling.pooling.serving import OpenAIServingPooling from vllm.entrypoints.pooling.score.serving import ScoreRequest, RerankRequest from vllm.entrypoints.openai.serving_models import OpenAIServingModels, BaseModelPath from vllm.outputs import RequestOutput from vllm.sampling_params import SamplingParams from vllm.utils import random_uuid from vllm.entrypoints.utils import process_chat_template from prometheus_client import start_http_server import base64 from red_serving_redkv import load_image_from_redis_cache from concurrent.futures import ThreadPoolExecutor import torch _LOCAL_LOGGING_INTERVAL_SEC = 5 @dataclass class ServingArgs: lora_modules: list = None prompt_adapters: list = None response_role:str = "assistant" chat_template = None chat_template_content_format = "auto" return_tokens_as_token_ids: bool = False enable_auto_tool_choice: bool = False tool_call_parser: str = None reasoning_parser: str = "" enable_prompt_tokens_details: bool = False trust_request_chat_template: bool = False class Plugin(BaseInference): def __init__(self): super().__init__() torch.set_num_threads(16) # speed torch cpu caculate. def create_async_engine_args( self, directory: str = "/workspace/models/", filename: str = "config.json", task: str = "generate", ) -> AsyncEngineArgs: def find_directories_with_model(directory, filename): directories = set() for root, _, filenames in os.walk(directory): if filename in filenames: directories.add(root) assert len(directories) == 1, print(f"There are {len(directories)} models") return list(directories) if directory=="/workspace/models/": model_path = find_directories_with_model(directory, filename) else: model_path = [directory] engine_args = AsyncEngineArgs(model_path[0]) engine_args.task = task engine_args.trust_remote_code = True return engine_args def set_init_args(self, args: str) -> None: start_http_server(int(os.getenv("ADD_METRICS_PORT","9999"))) # config from config.yaml vllm_use_v1 = os.environ.get('VLLM_USE_V1') self.logger.info(f"vllm_use_v1: {vllm_use_v1}") self.config_args = yaml.safe_load(args) serving_args = ServingArgs() # default config if "model" in self.config_args: self.engine_args = self.create_async_engine_args( directory=self.config_args["model"], task=self.config_args.get("task", "generate") ) else: self.logger.info("Don't find model_path in svc config. Use default model_path: /workspace/models/") self.engine_args = self.create_async_engine_args() self.task = self.config_args.get("task", "generate") # update config if "served_model_name" in self.config_args: if isinstance(self.config_args["served_model_name"], list): self.engine_args.served_model_name = self.config_args["served_model_name"] else: self.engine_args.served_model_name = [self.config_args["served_model_name"]] if "scheduler_config" in self.config_args: for key, value in self.config_args["scheduler_config"].items(): if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) else: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") for key, value in self.config_args.items(): supported = False if key in ["model", "served_model_name", "scheduler_config", "generation_config"]: continue if hasattr(self.engine_args, key): setattr(self.engine_args, key, value) supported = True if hasattr(serving_args, key): setattr(serving_args, key, value) supported = True if not supported: self.logger.warning(f"the backend engine doesn't support attribute: {key}!") self.logger.info(f"engine_args is: {self.engine_args}") if self.engine_args.task == "generate" and vllm_use_v1 != "0": self.engine = AsyncLLM.from_engine_args(self.engine_args) model_config = self.engine.model_config else: self.engine = AsyncLLMEngine.from_engine_args(self.engine_args) if isinstance(self.engine, AsyncLLM): model_config = self.engine.model_config # for V1 (vllm>=0.9.2) else: model_config = self.engine.engine.model_config # for V0 served_model_names = [self.engine_args.model] if self.engine_args.served_model_name is None else self.engine_args.served_model_name base_model_paths = [ BaseModelPath(name=name, model_path=self.engine_args.model) for name in served_model_names ] self.serving_model = OpenAIServingModels(self.engine, base_model_paths, lora_modules=serving_args.lora_modules) resolved_chat_template = asyncio.run(process_chat_template(serving_args.chat_template, self.engine, model_config)) self.logger.info(resolved_chat_template) if self.engine_args.task == "generate": self.adapter = TypeAdapter(ChatCompletionRequest) self.openai_serving_chat = OpenAIServingChat(self.engine, self.serving_model, response_role=serving_args.response_role, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, return_tokens_as_token_ids=serving_args.return_tokens_as_token_ids, enable_auto_tools=serving_args.enable_auto_tool_choice, tool_parser=serving_args.tool_call_parser, reasoning_parser=serving_args.reasoning_parser, enable_prompt_tokens_details=serving_args.enable_prompt_tokens_details,) elif self.engine_args.task == "embed": self.adapter = TypeAdapter(EmbeddingRequest) self.openai_serving_embedding = OpenAIServingEmbedding(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task == "score": if self.task == "score": self.adapter = TypeAdapter(ScoreRequest) elif self.task == "rerank": self.adapter = TypeAdapter(RerankRequest) self.serving_scores = ServingScores(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template,) elif self.engine_args.task == "classify": self.adapter = TypeAdapter(ClassificationRequest) self.serving_classification = ServingClassification(self.engine, self.serving_model, request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) elif self.engine_args.task in ["token_embed", "token_classify"]: self.adapter = TypeAdapter(PoolingRequest) self.serving_pooling = ServingPooling(self.engine, self.serving_model, supported_tasks=[self.engine_args.task], request_logger=None, chat_template=resolved_chat_template, chat_template_content_format=serving_args.chat_template_content_format, trust_request_chat_template=serving_args.trust_request_chat_template,) self.latest_request_time = int(datetime.datetime.timestamp(datetime.datetime.now())) if not self.engine_args.disable_log_stats and self.loop is not None: self.logger.info("self.loop is not None") async def _force_log(): while True: await asyncio.sleep(_LOCAL_LOGGING_INTERVAL_SEC) # if no request, report stats every 60s now = int(datetime.datetime.timestamp(datetime.datetime.now())) if now - self.latest_request_time > _LOCAL_LOGGING_INTERVAL_SEC: await self.engine.do_log_stats() asyncio.run_coroutine_threadsafe(_force_log(), self.loop) self.load_image_executor = ThreadPoolExecutor(max_workers=16) async def pre_process(self, request_body, cache_keys): messages = request_body.get("messages", []) if messages: # 加载 RedKV 数据 for message in messages: if message["role"] == "user": if isinstance(message["content"], list): # 并行加载图片 image_tasks = [] for content in message["content"]: if content["type"] == "image_url": image_url = content["image_url"]["url"] is_cached = False for cache_key in cache_keys: cache_url = cache_key[len("imagetransfer_"):] image_prefix = image_url.split('?')[0] if cache_url[:len(image_prefix)] == image_prefix: is_cached = True image_tasks.append((content, cache_key, image_url)) break # 并行执行所有图片加载任务 if image_tasks: start_time = time.time() futures = [] for content, key, http_url in image_tasks: fut = asyncio.get_running_loop().run_in_executor(self.load_image_executor, load_image_from_redis_cache, key) futures.append(fut) # futures.append(.submit(load_image_from_redis_cache, key)) for (content, key, http_url), future in zip(image_tasks, futures): try: img = await future if img is not None: mime_type = 'application/octet-stream' encoded_data = base64.b64encode(img).decode('utf-8') url = f'data:{mime_type};base64,{encoded_data}' content["image_url"]["url"] = url else: content["image_url"]["url"] = http_url except Exception as e: self.logger.error(f"load image from redis cache error: {e}") content["image_url"]["url"] = http_url end_time = time.time() self.logger.info(f"parallel load {len(image_tasks)} images from redis cache time: {end_time - start_time}") else: assert isinstance(message["content"], str) request_body["messages"] = messages return request_body async def post_process(self, result): return result.model_dump() def finish(self, msg, stream): if stream: self.stream_start() self.stream(msg) self.stream_end() else: if self.req_helper.get_req_type() == RpcResourceRequestType: result = Result() result.message = msg result.code = 0 result.success = True return result return json.dumps({"code":400, "message": msg}) @AsyncDecorator async def handle(self, request: str, mq_req: str) -> Any: terminate = False # update arrival time of last request self.latest_request_time = datetime.datetime.now() cache_keys = [] if self.req_helper.get_req_type() == RpcResourceRequestType: raw_request, _ = self.get_raw_request() request = raw_request.requestData["requestJson"] cache_data = raw_request.featureData.get('resourceCacheKeys', None) if cache_data != None: cache_keys = cache_data.stringListValue request_body: Dict[str, Any] = json.loads(request) self.logger.info(f"request = {request_body}, cache_keys = {cache_keys}") request_body = await self.pre_process(request_body, cache_keys) # request_body = await self.pre_process(request) debug_info = request_body.get("debug_info", False) stream = request_body.get("stream", False) try: request = self.adapter.validate_python(request_body) except Exception as e: self.logger.error(e) return self.finish(str(e), stream) if self.engine_args.task == "generate": generator = self.openai_serving_chat.create_chat_completion(request) request_id = f"chatcmpl-{request.request_id}" elif self.engine_args.task == "embed": generator = self.openai_serving_embedding.create_embedding(request) request_id = "0" elif self.engine_args.task == "score": if self.task == "rerank": generator = self.serving_scores.do_rerank(request) else: generator = self.serving_scores.create_score(request) request_id = "0" elif self.engine_args.task == "classify": generator = self.serving_classification.create_classify(request, None) request_id = "0" elif self.engine_args.task in ["token_embed", "token_classify"]: generator = self.serving_pooling.create_pooling(request) request_id = f"pool-{request.request_id}" user_model_name = request.model # set request's model to served model name. request.model = self.serving_model.model_name() stream = request_body.get("stream", False) if stream: self.stream_start() async for output in await generator: if output.strip() != "data: [DONE]": body = json.loads(output[len("data:"):]) # self.logger.info(output) # recover user model name setting body["model"] = user_model_name output = "data: " + json.dumps(body, ensure_ascii=False) + "\n\n" if not self.stream(output): # request disconnected. await self.engine.abort(request_id) break self.stream_end() else: async def listen_disconnect(): while True: if self.is_canceled(): await self.engine.abort(request_id) return await asyncio.sleep(0.1) listen_task = asyncio.create_task(listen_disconnect()) gen_task = asyncio.create_task(generator) final_res = await gen_task # recover user model name setting final_res.model = user_model_name listen_task.cancel() response = await self.post_process(final_res) if self.req_helper.get_req_type() == RpcResourceRequestType: resp = ResourceResponse() resp.resourceResult = ResourceResult(modelStatus=0) resp.resourceResult.modelResult = ModelResultInfo(label=json.dumps(response,ensure_ascii=False)) resp.result = Result(success=True, code=0, message='success') self.res_helper.set_rpc_response(resp) return self.res_helper.generate_response_and_return(terminate=terminate) return response ===== /workspace/red_serving_py_plugins/resources/py_infer_params.py ===== # -*- coding: utf-8 -*- from enum import Enum import red_serving_def class RequestType(Enum): RPCRESOURCE = 1 RPCBIZ = 2 MQ = 3 UNKNOWN = 4 HTTPRESOURCE = 5 RPCTITAN = 6 HTTPSTREAM = 7 class PyTensor(object): def __init__(self, name, np_data): self.name_ = name self.np_data_ = np_data def name(self): return self.name_ def as_numpy(self): return self.np_data_ def shape(self): return self.np_data_.shape def dtype(self): return self.np_data_.dtype def is_gpu_mem(self): return False class PyInferParameter(object): def __init__(self, trace_id="", input_string="", input_map = {}, input_tensors = [], type=0, name=None, requestType=RequestType.UNKNOWN ): self.trace_id_ = trace_id self.input_string_ = input_string self.input_map_ = input_map if requestType == RequestType.RPCRESOURCE: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "rpc-resource-query" elif requestType == RequestType.RPCBIZ: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "rpc-biz-query" elif requestType == RequestType.MQ: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "mq-msg" elif requestType == RequestType.HTTPRESOURCE: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "http-resource-query" elif requestType == RequestType.RPCTITAN: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "rpc-titan-query" elif requestType == RequestType.HTTPSTREAM: self.input_map_[red_serving_def.DefaultRequestTypePrefix] = "http-stream-resource-query" self.input_tensors_ = input_tensors # 0: infer_param 1: cache_param self.type_ = type self.name_ = name def param_type(self, ): return self.type_ def param_name(self, ): return self.name_ def trace_id(self, ): return self.trace_id_ def input_bytes(self, ): if isinstance(self.input_string_, str): return bytes(self.input_string_, encoding='utf-8') elif isinstance(self.input_string_, bytes): return self.input_string_ def input_string(self, ): return self.input_string_ def set_name_and_type(self, name, type): self.name_ = name self.type_ = type def attach_rpc_res(self, response): self.input_map_["RpcRes"] = response def get_rpc_res(self): if "RpcRes" in self.input_map_.keys(): return self.input_map_["RpcRes"] else: return None def input_tensors(self, ): return self.input_tensors_ def input_map(self, ): return self.input_map_ ===== /workspace/red_serving_py_plugins/resources/py_red_serving_utils.py ===== import os import yaml # import logging import requests import traceback import threading from CosClient import CosClient from colored import fg, bg, attr # logger = logging.getLogger(__name__) # logger.setLevel(logging.INFO) from loguru import logger def load_model_params(config_path): svc_conf={} with open(config_path, 'r', encoding="utf-8") as f: file_data = f.read() svc_conf = yaml.load_all(file_data, Loader=yaml.FullLoader) for service_config in svc_conf: logger.info("service_config: {}".format(service_config)) model_params = [] if "model_settings" in service_config.keys(): model_names_in_settings = [] for model_setting in service_config["model_settings"]: model_names_in_settings.append(model_setting["name"]) model_params.append({"model_name" : model_setting["name"], "model_placement": model_setting.get("model_placement", "cos"), "model_repo_path": model_setting.get("model_repo_path", "")}) # Check the consistency of model names if "workflows" in service_config.keys(): model_names_in_workflows = [] for node in service_config["workflows"][0]["nodes"]: if node["type"] == "model_infer": model_names_in_workflows.append(node["conf"]["name"]) if model_names_in_workflows != model_names_in_settings: logger.error("model_names_in_workflows is not equal to model_names_in_settings. Please check your yaml file.") logger.error("model_names_in_workflows: {}".format(model_names_in_workflows)) logger.error("model_names_in_settings: {}".format(model_names_in_settings)) return [] elif "red_service" in service_config.keys(): model_placement = service_config["red_service"].get("model_placement", "cos") model_repo_path = service_config["red_service"].get("model_repo_path", "") for node in service_config["workflows"][0]["nodes"]: if node["type"] == "model_infer": model_params.append({"model_name" : node["conf"]["name"], "model_placement": model_placement, "model_repo_path": model_repo_path}) return model_params return [] def guess_model_type(model_path): model_type = model_path.split(".")[-1] if model_type in ['pt', 'pth', 'jit']: return "torchscript" if model_type in ['onnx']: return "onnx" if model_type in ['plan', 'trt', 'engine']: return "tensorrt" if model_type in ['lrt']: return "lightruntime" if model_type in ['mindir']: return "mindspore_lite" return None def get_local_model(model_repo_path, model_name): def get_file_path(file_path): all_file_path=[] files = os.listdir(file_path) for file in files: fn = os.path.join(file_path, file) if os.path.isdir(fn): all_file_path.extend(get_file_path(fn)) else: all_file_path.append(fn) return all_file_path # A. get all models if len(model_repo_path) > 0 and model_repo_path[-1] != "/": model_repo_path += "/" if len(model_name) > 0 and model_name[-1] != "/": model_name += "/" all_model_path = get_file_path(model_repo_path+model_name) # B. filter newest model objects=[] map_objects={} for model_path in all_model_path: if "yml" not in model_path and "yaml" not in model_path: index = model_path.rfind("/") objects.append(model_path[:index]) map_objects[model_path[:index]]=model_path objects.sort() if len(objects) <= 0: return "" else: return map_objects[objects[-1]] def generate_params(config_path, device=None): params={"model" :[], "device": "cpu", "config": config_path, "debug" : True,} try: cos_client = CosClient() model_params = load_model_params(config_path) for model_param in model_params: if model_param["model_placement"] == "cos": model_path = cos_client.get_model_core(model_param["model_repo_path"], model_param["model_name"]) if model_path=="": logger.error(f'download model failed: no model with name "{model_param["model_name"]}" in remote path "{model_param["model_repo_path"]}".') else: model_path = get_local_model(model_param["model_repo_path"], model_param["model_name"]) if model_path=="": logger.error(f'get model failed: no model with name "{model_param["model_name"]}" found in local path "{model_param["model_repo_path"]}".') model_type = guess_model_type(model_path) if model_type is None : logger.warning('model type is regarded as "None"') else : logger.info(f'model type is regarded as "{model_type}"') params["model"].append({"model_name": model_param["model_name"], "model_path": model_path, "model_type": model_type, "model_repo_path": model_param["model_repo_path"], "model_placement": model_param["model_placement"]}) if model_type == "tensorrt": params["device"] = "cuda:0" except: logger.error("load model failed due to: {}".format(traceback.format_exc())) if device is not None: params["device"] = device return params def download_url(url, timeout=2) : retry_times = 3 for idx in range(retry_times) : try: resp = requests.get(url, timeout=timeout) if resp.ok : return resp.content else: logger.error("code = {}, text = {}", resp.status_code, resp.text) except: if idx == retry_times - 1: logger.error("Download failed! url: {}, exception: {}".format(url, traceback.format_exc())) return None def download_files(urls, timeout=2) : imgs = [] if isinstance(urls, str) : urls = [urls] if not isinstance(urls, list): logger.error("urls MUST be list! urls: {}".format(urls)) return imgs try: files = {} def dnld(url, timeout) : files[url] = download_url(url, timeout=timeout) thds = [] for url in urls : t = threading.Thread(target = dnld, args = (url, timeout, )) t.daemon = True t.start() thds.append(t) for t in thds: t.join() for url in urls: imgs.append(files[url]) except: logger.error(traceback.format_exc()) return imgs if __name__ == "__main__": params = generate_params("svc.yaml") print(params) ===== /workspace/red_serving_py_plugins/resources/red_serving_tool.py ===== # -*- coding: utf-8 -*- import red_serving_def import numpy as np import json import pickle import traceback import time import os import re import torch import MetricLogger import threading from pyapollo import ApolloClient from redserving_logger.logger import Logger from red_serving_common import BatchingRequestType logger = Logger() class OfflineBatchingLog: """Created by ray_redserving for use by StatLogger.""" def __init__(self): # ray stats worker_batch_parallelism self.worker_batch_size = 0 self.worker_gpu_num = 0 self.worker_cpu_num = 0 self.node_name = " " # model state self.model_name = " " self.model_scheduler = " " self.model_backend_type = " " self.service_name = "ray_redserving" self.job_id = os.getenv("QS_JOB_ID", "000000") self.trial_id = os.getenv("QS_TRIAL_ID", "000000") self.qs_id = os.getenv("QS_BIZ_ID", "000000") self.device_type = os.getenv("GPU_TYPE", "unknown_type") # redserving image version self.get_redserving_version() self.media_metric = MetricLogger.MetricLogger("ray_redserving", "redserving") self.run_flag = False def get_redserving_version(self): """从/workspace/VERSION读取redserving_version""" file_path = "/workspace/VERSION" with open(file_path, "r") as file: content = file.read() pattern = re.compile(r"RED-SERVING-VERSION:\s*(.*)") match = pattern.search(content) self.redserving_version = match.group(1) return match # 在RayProcessing实例中进行的信息发送 def _send_ray_info(self): while self.run_flag: self.media_metric.sendValue( {"worker_batch_size": self.worker_batch_size}, tags={ "metrics": "worker_batch_size", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "node_name": self.node_name, }, ) self.media_metric.sendValue( {"worker_gpu_num": self.worker_gpu_num}, tags={ "metrics": "worker_gpu_num", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "node_name": self.node_name, }, ) self.media_metric.sendValue( {"worker_cpu_num": self.worker_cpu_num}, tags={ "metrics": "worker_cpu_num", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "node_name": self.node_name, }, ) self.media_metric.sendCounter( {"redserving_version": 1}, tags={ "metrics": "redserving_version", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "version": self.redserving_version, }, ) self.media_metric.sendCounter( {"service_name": 1}, tags={ "metrics": "service_name", "service": self.service_name, "qs_id": self.qs_id, "job_id": self.job_id, "trial_id": self.trial_id, "device_type": self.device_type, }, ) time.sleep(1) # 在InferProcess实例中进行的信息发送 def _send_infer_info(self): while self.run_flag: self.media_metric.sendCounter( {"model_name": 1}, tags={ "metrics": "model_name", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "model_name": self.model_name, }, ) self.media_metric.sendCounter( {"model_scheduler": 1}, tags={ "metrics": "model_scheduler", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "version": self.model_scheduler, }, ) self.media_metric.sendCounter( {"model_backend_type": 1}, tags={ "metrics": "model_backend_type", "service": self.service_name, "job_id": self.job_id, "trial_id": self.trial_id, "type": self.model_backend_type, }, ) time.sleep(1) def run_metrics(self, target_func): self.run_flag = True self.thread = threading.Thread(target=target_func) self.thread.start() def stop_metrics(self): self.run_flag = False self.thread.join() class InnerApolloClient(object): def __init__(self, app_id): CONFIG_SERVER_MAP = { "dev": "http://apollocc-cs-dev.sit.xiaohongshu.com", "test": "http://apollocc-cs-tst.sit.xiaohongshu.com", "sit": "http://apollocc-cs-sit.sit.xiaohongshu.com", "beta": "http://apollocc-cs.int.beta.xiaohongshu.com", "prod": "http://apollocc-cs.int.xiaohongshu.com", } self.client = ApolloClient( app_id=app_id, cluster="default", config_server_url=CONFIG_SERVER_MAP[os.environ.get("XHS_ENV", "prod")], ) def get_key(self, secret_id, secret_key): SECRET_ID = self.client.get_value(key=secret_id, namespace="kms") SECRET_KEY = self.client.get_value(key=secret_key, namespace="kms") return SECRET_ID, SECRET_KEY def get_apollo_client(self): return self.client class StubGpuMemSharing(object): __enabled_sharing = False @classmethod def is_enabled(cls): return cls.__enabled_sharing @classmethod def enable(cls, enable): cls.__enabled_sharing = enable def enbale_stub_gpu_mem_sharing(self, gpu_ids): if gpu_ids >= 0: ################################################################### # Turn off torch cache allocator for redsering gpu memory sharing # # If enabled, the result will be abnormal # # disable_torch_cache_allocator # ################################################################### StubGpuMemSharing.enable(True) os.environ["PYTORCH_NO_CUDA_MEMORY_CACHING"] = "1" os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_ids) torch.cuda.set_device(gpu_ids) Tensor.warmup_ipc_mem() class RpcMqRequest(object): request_param = None req_ctx_source_type = None def __init__(self, infer_param): self.request_param = infer_param def get_req_type(self): if self.req_ctx_source_type is not None: return self.req_ctx_source_type for k, v in self.request_param.input_map().items(): if k.startswith(red_serving_def.DefaultRequestTypePrefix): self.req_ctx_source_type = v return self.req_ctx_source_type def get_raw_input(self): return self.request_param.input_bytes() def get_titan_dtype(self): for k, v in self.request_param.input_map().items(): if k.startswith(red_serving_def.DefaultTitanDtype): return v return None """ def is_resource_query(self): if self.get_req_type() == RpcResourceRequestType: return True return False def is_biz_query(self): if self.get_req_type() == RpcBizRequestType: return True return False def get_rpc_resource_request(self): if self.is_resource_query() is not True: return None if self.request_param is None: return None return red_serving_def.DeserializeThrift(self.get_raw_input(), ResourceRequest) def get_rpc_biz_request(self): if self.is_biz_query() is not True: return None if self.request_param is None: return None return red_serving_def.DeserializeThrift(self.get_raw_input(), BizIDRequest) def get_mq_msg(self): return self.get_raw_input() """ def deserialize_thrift(self, val, th_obj_type): return red_serving_def.DeserializeThrift(val, th_obj_type) class RedServingRequestHelper(object): infer_param_list = [] first_infer_param = None req_ctx_source_type = None cache_params = {} trace_id = "" RpcMqRequestHelper = None def __init__(self): pass def reset(self, infer_param_list): self.infer_param_list = [] self.first_infer_param = None self.req_ctx_source_type = None self.cache_params = {} self.RpcMqRequestHelper = None self.trace_id = "" self.init(infer_param_list) def init(self, infer_param_list): if isinstance(infer_param_list, list) is not True: return False if len(infer_param_list) == 0: return False self.infer_param_list = infer_param_list for param in infer_param_list: if param.param_type() == red_serving_def.DefaultCacheType: self.cache_params[param.param_name()] = param else: for k, v in param.input_map().items(): if k.startswith(red_serving_def.DefaultRequestTypePrefix): self.RpcMqRequestHelper = RpcMqRequest(param) if self.first_infer_param is None: self.first_infer_param = param if len(self.trace_id) == 0: self.trace_id = param.trace_id() def get_trace_id(self): return self.trace_id def get_req_type(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_req_type() else: return None def get_titan_dtype(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_titan_dtype() else: return None def get_raw_input(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_raw_input() else: return None """ def is_resource_query(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.is_resource_query() else: return False def get_rpc_resource_request(self): warnings.warn("func:get_rpc_resource_request is deprecated and moved to base_inference.py", DeprecationWarning) if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_rpc_resource_request() else: return None def is_biz_query(self): warnings.warn("func:is_biz_query is deprecated", DeprecationWarning) if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.is_biz_query() else: return None def get_rpc_biz_request(self): warnings.warn("func:get_rpc_biz_request is deprecated", DeprecationWarning) if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_rpc_biz_request() else: return None def is_mq_msg(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_req_type() == MqType return False def get_mq_msg(self): if self.RpcMqRequestHelper is not None: return self.RpcMqRequestHelper.get_mq_msg() else: return None """ def get_input_tensors(self): ts = [] for t in self.first_infer_param.input_tensors(): ts.append(self.convert_from_pbtensor(t)) return ts def get_input_tensors_as_dict(self): ts = {} for t in self.first_infer_param.input_tensors(): ts[t.name()] = self.convert_from_pbtensor(t) return ts def get_infer_results_as_dict(self): ts = {} for param in self.infer_param_list: if param.param_type() != 0: continue model_name = None for k, v in param.input_map().items(): if k.startswith(red_serving_def.DefaultModelNameKey): model_name = v if model_name is None: # logger.error("Got no model_name") continue ts1 = {} for t in param.input_tensors(): ts1[t.name()] = self.convert_from_pbtensor(t) ts[model_name] = ts1 return ts def get_infer_results(self): ts = {} for param in self.infer_param_list: if param.param_type() != 0: continue model_name = None for k, v in param.input_map().items(): if k.startswith(red_serving_def.DefaultRequestTypePrefix): model_name = v if model_name is None: logger.error("Got no model_name") continue ts1 = [] for t in param.input_tensors(): ts1[t.name()] = self.convert_from_pbtensor(t) ts[model_name] = ts1 return ts def get_user_cache(self, cache_key): cache_key = red_serving_def.DefaultCacheKeyPrefix + cache_key for k, v in self.cache_params.items(): if k == cache_key: input_map = v.input_map() if red_serving_def.DefaultCacheValueTypeKey not in input_map.keys(): logger.error("cache_data_type not set") return None if input_map[red_serving_def.DefaultCacheValueTypeKey] == "numpy": if len(v.input_tensors()) == 0: logger.error("cache_data not saved.") return None return v.input_tensors()[0].as_numpy() if input_map[red_serving_def.DefaultCacheValueTypeKey] == "json": return json.loads(v.input_bytes()) if input_map[red_serving_def.DefaultCacheValueTypeKey] == "pickle": return pickle.loads(v.input_bytes()) if input_map[red_serving_def.DefaultCacheValueTypeKey] == "str": return v.input_string() if input_map[red_serving_def.DefaultCacheValueTypeKey] == "bytes": return v.input_bytes() if input_map[red_serving_def.DefaultCacheValueTypeKey] == "float": return float(v.input_string()) if input_map[red_serving_def.DefaultCacheValueTypeKey] == "int": return int(v.input_string()) return None def convert_from_pbtensor(self, tensor): if tensor.is_gpu_mem(): return torch.utils.dlpack.from_dlpack(tensor.to_dlpack_4_torch()) else: return tensor.as_numpy() class OfflineBatchingRequestHelper(RedServingRequestHelper): def __init__(self): super().__init__() self.hive_input_data = None self.hive_request_type = BatchingRequestType def get_raw_input(self): return self.hive_input_data def get_input_tensors(self): ts = [] for key in self.hive_input_data: if "model_output_" in key: data = self.hive_input_data[key] ts.append(data) return ts def get_req_type(self): return self.hive_request_type def get_user_cache(self, cache_key): cache_key = red_serving_def.DefaultCacheKeyPrefix + cache_key return self.hive_input_data.get(cache_key) def get_input_tensors_as_dict(self): ts = {} for key in self.hive_input_data: if "model_output_" in key: name = key.replace("model_output_", "", 1) ts[name] = self.hive_input_data[key] return ts class RedServingResponseHelper(object): def __init__(self): self.input_string = "" self.input_map = {} # user defined map and user cache self.input_tensors = [] self.trace_id = "" self.res_params = [] self.cache_isset = False self.hive_isset = False self.rpc_result_isset = False self.input_tensor_idx = 0 self.rpc_response = None def reset(self, trace_id=""): self.input_string = "" self.input_map = {} # user defined map and user cache self.input_tensors = [] self.res_params = [] self.trace_id = trace_id self.cache_isset = False self.hive_isset = False self.rpc_result_isset = False self.input_tensor_idx = 0 self.rpc_response = None def set_string_data(self, string_data): self.input_string = string_data return True def set_kv_record(self, key, value): ## TODO 如果map[cache_key/cache_value] is set, return 报错 self.input_map[red_serving_def.DefaultRedKvKey] = key self.input_map[red_serving_def.DefaultRedKvValue] = value self.cache_isset = True return True def set_hive_record(self, value): ## TODO 如果map[hive_record] is set, return 报错 self.input_map[red_serving_def.DefaultHiveRecordKey] = value self.hive_isset = True return True def set_rpc_response(self, value): self.rpc_response = self.serialize_thrift(value) return True def set_http_response(self, value): try: self.rpc_response = json.dumps(value) except: self.rpc_response = traceback.format_exc() return True def append_tensors(self, tensors): if isinstance(tensors, list): self.input_tensors = self.input_tensors + tensors else: self.input_tensors.append(tensors) return True def add_infer_tensor(self, tensor, name=""): if len(name) == 0: name = "INPUT__" + str(self.input_tensor_idx) self.input_tensor_idx = self.input_tensor_idx + 1 new_tensor = self.convert_to_pbtensor(name, tensor) if new_tensor is not None: self.append_tensors(new_tensor) return True else: logger.error(f"input tensor must be numpy array for {name}") return False def clear_history_cache(self): control_key = red_serving_def.DefaultControlKeyPrefix + "clear_history" isset = False for k, v in self.input_map.items(): if k == control_key: self.input_map[k] = "True" isset = True if isset is not True: self.input_map[control_key] = "True" return True def add_user_cache(self, cache_key, cache_value): ## TODO 判断重名 cache_key = red_serving_def.DefaultCacheKeyPrefix + cache_key if isinstance(cache_value, np.ndarray): t = Tensor(cache_key, cache_value) input_map = {} input_map[red_serving_def.DefaultCacheValueTypeKey] = "numpy" cache_param = InferParameter(self.trace_id, "", input_map, [t]) cache_param.set_name_and_type(cache_key, red_serving_def.DefaultCacheType) self.res_params.append(cache_param) elif isinstance(cache_value, (tuple, list, dict)): input_map = {} cached_str = None input_map[red_serving_def.DefaultCacheValueTypeKey] = "json" if isinstance(cache_value, (tuple, list)): for item in cache_value: if isinstance(item, (bytes, float, int, str)) is not True: input_map[red_serving_def.DefaultCacheValueTypeKey] = "pickle" else: for k, v in cache_value.items(): if ( isinstance(k, (float, int, str, bytes)) is not True or isinstance(v, (bytes, float, int, str)) is not True ): input_map[red_serving_def.DefaultCacheValueTypeKey] = "pickle" if input_map[red_serving_def.DefaultCacheValueTypeKey] == "json": cached_str = json.dumps(cache_value) else: cached_str = pickle.dumps(cache_value) cache_param = InferParameter(self.trace_id, cached_str, input_map, []) cache_param.set_name_and_type(cache_key, red_serving_def.DefaultCacheType) self.res_params.append(cache_param) elif isinstance(cache_value, (str, bytes)): input_map = {} input_map[red_serving_def.DefaultCacheValueTypeKey] = type( cache_value ).__name__ cache_param = InferParameter(self.trace_id, cache_value, input_map, []) cache_param.set_name_and_type(cache_key, red_serving_def.DefaultCacheType) self.res_params.append(cache_param) elif isinstance(cache_value, (float, int)): input_map = {} input_map[red_serving_def.DefaultCacheValueTypeKey] = type( cache_value ).__name__ cache_param = InferParameter(self.trace_id, str(cache_value), input_map, []) cache_param.set_name_and_type(cache_key, red_serving_def.DefaultCacheType) self.res_params.append(cache_param) else: logger.error( "not supported value type, cache_key:{} type:{}".format( cache_key, type(cache_key) ) ) return False return True def serialize_thrift(self, th_obj): return red_serving_def.SerializeThrift(th_obj) def generate_serving_param(self, terminate=False): if terminate is True: self.input_map[ red_serving_def.DefaultControlKeyPrefix + "terminate_workflow" ] = "True" return InferParameter( self.trace_id, self.input_string, self.input_map, self.input_tensors ) def generate_response(self, param): self.res_params.append(param) return self.res_params def generate_response_and_return(self, terminate=False): # 判断是否包含c++的InferParameter函数,如果没有则调用py_infer_params下的InferParameter模块 try: param = self.generate_serving_param(terminate=terminate) except NameError: from py_infer_params import PyInferParameter as InferParameter globals()["InferParameter"] = InferParameter param = self.generate_serving_param(terminate=terminate) if self.rpc_response is not None: param.attach_rpc_res(self.rpc_response) return self.generate_response(param) def convert_to_pbtensor(self, name, tensor): if isinstance(tensor, (np.ndarray, np.generic)): return Tensor(name, tensor) elif isinstance(tensor, torch.Tensor): if tensor.is_cuda: if StubGpuMemSharing.is_enabled(): return Tensor.from_dlpack_4_torch( name, torch.utils.dlpack.to_dlpack(tensor) ) else: return Tensor(name, tensor.detach().cpu().numpy()) else: return Tensor(name, tensor.numpy()) return None def update_input_map(self, k, v): if len(self.input_map) > red_serving_def.DefaultMaxMetricsNums: logger.error( "Add new metric key: {}, value: {} failed! Metrics num exceeds {}".format( k, v, red_serving_def.DefaultMaxMetricsNums ) ) else: self.input_map[k] = v class OfflineBatchingResponseHelper(RedServingResponseHelper): def __init__(self): super().__init__() self.hive_response = {} def add_infer_tensor(self, tensor, name=""): if len(name) == 0: name = "INPUT__" + str(self.input_tensor_idx) self.input_tensor_idx = self.input_tensor_idx + 1 infer_tensor_name = red_serving_def.DefaultInferKeyPrefix + name self.hive_response[infer_tensor_name] = tensor return True def add_user_cache(self, cache_key, cache_value): ## TODO 判断重名 cache_key = red_serving_def.DefaultCacheKeyPrefix + cache_key self.hive_response[cache_key] = cache_value return True def set_hive_response(self, value): self.hive_response = value return True def get_hive_response(self): return self.hive_response ===== /workspace/red_serving_py_plugins/resources/red_serving_common.py ===== import numpy as np import os import traceback import torch torch.set_num_threads(4) import red_serving_def from redserving_logger.logger import Logger import asyncio import threading import json redserving_debug_mode = False BatchingRequestType = "batching-resource-query" log_fmt='{time:YYYYMMDD HH:mm:ss.SSSSSS} | PLUGIN | {level} | {process.id} | {message}' ## default log tool def GetLogger( log_path="/workspace/logs/runtime.log", log_level="INFO", format=log_fmt, rotation="500 MB", retention=5, use_kibana=False, ): return Logger( log_path=log_path, log_level=log_level, format=format, rotation=rotation, retention=retention, use_kibana=use_kibana, ) ## red_serving 要求 if os.environ.get("PY_RED_SERVING_DEBUG", None) is None: import red_serving_tool def ConvertToPbtensor(name, tensor): if isinstance(tensor, (np.ndarray, np.generic)): return red_serving_tool.Tensor(name, tensor) elif isinstance(tensor, torch.Tensor): if tensor.is_cuda: if red_serving_tool.StubGpuMemSharing.is_enabled(): tensor_dlpack = torch.utils.dlpack.to_dlpack(tensor) return red_serving_tool.Tensor.from_dlpack_4_torch( name, tensor_dlpack ) else: return red_serving_tool.Tensor(name, tensor.detach().cpu().numpy()) else: return red_serving_tool.Tensor(name, tensor.numpy()) return None def ConvertFromPbtensor(tensor): if tensor.is_gpu_mem(): return ( tensor.name(), torch.utils.dlpack.from_dlpack(tensor.to_dlpack_4_torch()), ) else: return (tensor.name(), tensor.as_numpy()) else: # redserving debug mode from py_infer_params import PyTensor import red_serving_tool_debug as red_serving_tool redserving_debug_mode = True def ConvertToPbtensor(name, tensor): if isinstance(tensor, torch.Tensor): if tensor.is_cuda: tensor = tensor.detach().cpu() tensor = tensor.numpy() return PyTensor(name, tensor) def ConvertFromPbtensor(tensor): return (tensor.name(), tensor.as_numpy()) class RequestSession: def __init__(self): self.trace_id = "" self.req_helper = red_serving_tool.RedServingRequestHelper() self.res_helper = red_serving_tool.RedServingResponseHelper() self.logger = GetLogger() self.latency_metric_prefix = "redserving_metric_" self.count_metric_prefix = "redserving_count_metric_" self.value_metric_prefix = "redserving_value_metric_" def reset(self, *args, **kwargs): self.req_helper.reset(*args) self.trace_id = self.req_helper.get_trace_id() self.res_helper.reset(self.trace_id) self.logger.set_trace_id(self.trace_id) req_type = self.req_helper.get_req_type() if req_type: self.res_helper.input_map[ red_serving_def.DefaultRequestTypePrefix ] = req_type def crud_model(self, msg): self.logger.info(msg) response = { "status": "success", "name": "unknown", "version": -1, } return json.dumps(response) def update_logger(rotation="500 MB", retention=5): self.logger.build_in_logger.remove(2) self.logger.build_in_logger.add( "/workspace/logs/runtime.log", format=log_fmt, rotation=rotation, retention=retention, ) def clear(self): self.req_helper.reset(None) def add_metrics_value(self, name, value): try: if not isinstance(name, str): name = str(name) if not isinstance(value, str): value = str(value) self.res_helper.update_input_map(self.value_metric_prefix + name, value) except: self.logger.error(traceback.format_exc()) def add_metrics_count(self, name, value): try: if not isinstance(name, str): name = str(name) if not isinstance(value, str): value = str(value) self.res_helper.update_input_map(self.count_metric_prefix + name, value) except: self.logger.error(traceback.format_exc()) def add_metrics_us(self, name, value): try: if not isinstance(name, str): name = str(name) if not isinstance(value, str): value = str(value) self.res_helper.update_input_map(self.latency_metric_prefix + name, value) except: self.logger.error(traceback.format_exc()) def add_metrics(self, name, value): value *= 1000000 self.add_metrics_us(name, value) def add_metrics_ms(self, name, value): value *= 1000 self.add_metrics_us(name, value) def is_http_request(self): raise Exception("Unimplemented!") def is_rpc_request(self): raise Exception("Unimplemented!") def is_stream_request(self): raise Exception("Unimplemented!") def get_raw_request(self): raise Exception("Unimplemented!") def stream(self, value): raise Exception("Unimplemented!") def stream_start(self, input_str=None): raise Exception("Unimplemented!") def stream_end(self): raise Exception("Unimplemented!") async def stream_async(self, value): raise Exception("Unimplemented!") async def remote_call(self, node_name: str, func_name: str, res_helper): raise Exception("Unimplemented!") class BasicInference(RequestSession): def __init__(self): super().__init__() if hasattr(red_serving_tool, "PyRemoteInferPlugin"): self.remote_infer = red_serving_tool.PyRemoteInferPlugin() else: import red_serving_tool_debug self.remote_infer = red_serving_tool_debug.PyRemoteInferPlugin() self.executor = None # Dict{key: model_name, values: InferEngine} self.engine = {} # indicate if async-mode self.enable_async_mode: bool = False self.loop: asyncio.BaseEventLoop = None self.background: threading.Thread = None def reset_remote_infer_handler(self, handler): self.remote_infer = handler def reset_helper(func): def wrapper(self: RequestSession, *args, **kwargs): self.reset(*args, **kwargs) result = func(self, *args, **kwargs) self.clear() return result return wrapper def forward(self, model_name, tensors): output_numpys = None try: input_tensors = {} if self.req_helper.get_req_type() == BatchingRequestType: model_engine = self.engine[model_name] if isinstance(tensors, (np.ndarray, np.generic, torch.Tensor)): input_tensors["INPUT__0"] = tensors elif isinstance(tensors, list): for idx in range(len(tensors)): tensor_name = "INPUT__" + str(idx) input_tensors[tensor_name] = tensors[idx] elif isinstance(tensors, dict): input_tensors = tensors output_data = model_engine.Forward(model_name, input_tensors) if isinstance(output_data, tuple) and len(output_data) > 1: output_numpys = output_data[1] else: raise RuntimeError( f"Forward output should be -> tuple(str, dict[str, numpy]), output_data:{output_data}" ) else: input_tensors = [] if isinstance(tensors, (np.ndarray, np.generic, torch.Tensor)): input_tensors.append(ConvertToPbtensor("INPUT__0", tensors)) elif isinstance(tensors, list): for idx in range(len(tensors)): tensor_name = "INPUT__" + str(idx) input_tensors.append( ConvertToPbtensor(tensor_name, tensors[idx]) ) elif isinstance(tensors, dict): for tensor_name, tensor in tensors.items(): input_tensors.append(ConvertToPbtensor(tensor_name, tensor)) else: raise RuntimeError( 'tensors should be single numpy or numpy list or dict=>{"name": numpy}' ) output_tensors = self.remote_infer.call( self.trace_id, model_name, input_tensors ) output_numpys = dict() for ot in output_tensors: out = ConvertFromPbtensor(ot) output_numpys[out[0]] = out[1] except: self.logger.error(traceback.format_exc()) return output_numpys def set_remote_infer_call(self, call_obj): return self.remote_infer.set(call_obj) def set_model_engine(self, engine): self.engine = engine def set_hive_resource_request(self, data): self.req_helper = red_serving_tool.OfflineBatchingRequestHelper() self.res_helper = red_serving_tool.OfflineBatchingResponseHelper() self.req_helper.hive_input_data = data ===== /workspace/red_serving_py_plugins/resources/base_media_inference.py ===== import os import traceback import numpy as np from loguru import logger import sys import time import json import redis from edsredis import EdsBlockingConnectionPool from concurrent.futures import ThreadPoolExecutor import requests import warnings # Dalao & DalaoProto & thrift related from downloader import MediaDownloader import DalaoProto.proto_helper as helper from DalaoProto.media_record_pb2 import MediaRecord from DalaoProto.service_type_pb2 import ServiceType from protobuf_to_dict import protobuf_to_dict from base_inference import BaseInference, HttpRequestType, RpcResourceRequestType from aimedia.modelinterface.ttypes import FeatureType from py_red_serving_utils import download_url from red_serving_redkv import get_redis_client white_lists = ["block_id", "file_id", "service", "source_type", "update_time", "user_update_time", \ "float_label_1", "float_label_2", "float_label_3", "string_label_1", "string_label_2", "string_label_3", \ "int_label_1", "int_label_2", "int_label_3", "user_id", "note_oid", "info"] class TypeConverter(json.JSONEncoder): def default(self, obj): if isinstance(obj, bytes): return obj.decode() if type(obj) in [np.float_, np.float16, np.float32, np.float64]: return float(obj) if type(obj) in [np.int_, np.intc, np.intp, np.int8, np.int16, np.int32, np.int64]: return int(obj) if type(obj) in [np.uint8, np.uint16, np.uint32, np.uint64]: return int(obj) if type(obj) in [np.bool_]: return True if obj else False return json.JSONEncoder.default(self, obj) def gen_dalao_mq_result(mq_msg, proto_resp): warnings.warn("as mq-mode is deprecating, this function is also deprecated", DeprecationWarning) kv_record_key = None kv_record_value = None hive_record = None if mq_msg is None or proto_resp is None: return kv_record_key, kv_record_value, hive_record try: mq_pb = MediaRecord() mq_pb.ParseFromString(mq_msg) mq_pb.update_time = int(time.time() * 1000) mq_pb.info = proto_resp.SerializeToString() if len(mq_pb.note_oid) > 0 or len(mq_pb.file_id) > 0: kv_record_key = helper.get_key(mq_pb) else: # image rpc mode kv_record_key = helper.get_key_by_url(mq_pb.url, mq_pb.service) for desc, _ in mq_pb.ListFields(): if desc.name not in white_lists: mq_pb.ClearField(desc.name) kv_record_value = mq_pb.SerializeToString() resp_dict = protobuf_to_dict(proto_resp, use_enum_labels=True) mq_pb.info = json.dumps(resp_dict, cls=TypeConverter, ensure_ascii=False).encode() proto_dict = protobuf_to_dict(mq_pb, use_enum_labels=True) hive_record = json.dumps(proto_dict, cls=TypeConverter, ensure_ascii=False).encode() except: logger.warning(traceback.format_exc()) return kv_record_key, kv_record_value, hive_record class BaseMediaInference(BaseInference): def __init__(self): super().__init__() self.downloader = MediaDownloader() self.redis_client = get_redis_client() self.img_download_pool = ThreadPoolExecutor(max_workers=64) def get_request(self, ): resource_req, proto = None, None try: resource_req, mq_msg = self.get_raw_request() if resource_req is not None: if self.req_helper.get_req_type() == RpcResourceRequestType: rpc_proto = MediaRecord() if resource_req.requestData.get('img_url', None) is not None: rpc_proto.url = resource_req.requestData['img_url'] rpc_proto.service = ServiceType.Value((resource_req.serviceType).upper()) self.res_helper.add_user_cache("mq_msg", rpc_proto.SerializeToString()) self.res_helper.add_user_cache("request_type", "rpc") elif mq_msg is not None: proto = MediaRecord() proto.ParseFromString(mq_msg) self.res_helper.add_user_cache("mq_msg", mq_msg) self.res_helper.add_user_cache("request_type", "mq") except: self.logger.error(traceback.format_exc()) return resource_req, proto def get_img(self, request=None, proto=None, url=None): img_url, img = url, None start_download = time.time() try: if proto is not None: img = self.downloader.download(proto) elif request is not None and request.featureData is not None: img = self.get_img_from_featuredata(request.featureData) else: if request is not None and request.requestData.get('img_url', None) is not None: img = self.downloader.download_by_url(request.requestData["img_url"]) except: self.logger.error(traceback.format_exc()) down_load_cost = time.time()-start_download self.logger.info(f"get_img cost: {1000*down_load_cost} ms") self.add_metrics("get_img_cost", down_load_cost) return img def get_img_from_featuredata(self, featureData): img_bin = None try: binary_data = featureData.get('binaryDatas', None) cache_data = featureData.get('resourceCacheKeys', None) imgurl_data = featureData.get('imageUrls', None) if binary_data is not None and binary_data.type == FeatureType.BINARY_LIST: img_bin = binary_data.binaryListValue[0] if len(binary_data.binaryListValue) == 1 else binary_data.binaryListValue if img_bin is None: # 通过redkv读图片缓存 if cache_data is not None and cache_data.type == FeatureType.STRING_LIST: cache_values = self.get_cache(cache_data.stringListValue) if cache_values is not None: if isinstance(cache_values, list): img_bin = cache_values[0] if len(cache_values) == 1 else cache_values else: img_bin = cache_values if img_bin is None: # 临时下图 if imgurl_data is not None and imgurl_data.type == FeatureType.STRING_LIST: img_datas = self.download_files(imgurl_data.stringListValue) img_bin = img_datas[0] if len(img_datas) == 1 else img_datas elif isinstance(img_bin, list) and None in img_bin: if imgurl_data is not None and imgurl_data.type == FeatureType.STRING_LIST and len(imgurl_data.stringListValue) == len(img_bin): self.logger.info("cache is None, try download image") need_download_idx = [idx for idx in range(len(img_bin)) if img_bin[idx] == None] need_download_image_urls = [imgurl_data.stringListValue[idx] for idx in need_download_idx] new_img_bins = self.download_files(need_download_image_urls) for i in range(len(need_download_idx)): img_bin[need_download_idx[i]] = new_img_bins[i] except: self.logger.error(traceback.format_exc()) if img_bin is None or (isinstance(img_bin, list) and None in img_bin): self.logger.error("img_bin is None or None in img_bin. featureData: {}".format(featureData)) return img_bin def download_files(self, urls): return list(self.img_download_pool.map(download_url, urls)) def get_cache(self, name, retry=3): value = None try: if isinstance(name, str) : value = self.redis_client.get(name = name) elif isinstance(name, list) : value = self.redis_client.mget(name) #handle the problem: some value is None if None in value: non_index, non_name= [], [] for index, val in enumerate(value): if val is None: non_index.append(index) non_name.append(name[index]) for _ in range(retry): tmp_val = self.redis_client.mget(non_name) for i, v in enumerate(tmp_val): if v is not None: value[non_index[i]] = v del non_name[i] del non_index[i] if len(non_name) <= 0: break except: self.redis_client = get_redis_client() self.logger.error(traceback.format_exc()) return value ===== /workspace/red_serving_py_plugins/resources/downloader.py ===== import logging import redis import os import traceback from time import time from edsredis import EdsBlockingConnectionPool from DalaoProto.proto_helper import download as download_by_proto from DalaoProto.proto_helper import get_prefix_suffix, download_files, get_bucket_fileid,download_cos_url, download_url from redserving_logger.logger import Logger logger = Logger() def get_address() : if os.environ.get('KUBERNETES_SERVICE_PORT') is not None : return '127.0.0.1' # servicemesh else : # virtual machine return '10.0.249.240' class MediaDownloader(object) : def __init__(self) : cache_service = os.environ.get("CACHE_SERVICE", "") if cache_service != "": eds_connection_pool = EdsBlockingConnectionPool(cluster_name=cache_service) self.client = redis.Redis(connection_pool=eds_connection_pool) else: self.client = redis.Redis(host = get_address(), port=os.environ.get("CACHE_PORT", 20320)) def get_cache(self, name, retry=1) : value = None try: if isinstance(name, str) : value = self.client.get(name = name) elif isinstance(name, list) : value = self.client.mget(name) if None in value: non_index, non_name= [], [] for index, val in enumerate(value): if val is None: non_index.append(index) non_name.append(name[index]) for _ in range(retry): tmp_val = self.client.mget(non_name) for i, v in enumerate(tmp_val): if v is not None: value[non_index[i]] = v del non_name[i] del non_index[i] if len(non_name) <= 0: break except: cache_service = os.environ.get("CACHE_SERVICE", "") if cache_service != "": eds_connection_pool = EdsBlockingConnectionPool(cluster_name=cache_service) self.client = redis.Redis(connection_pool=eds_connection_pool) else: self.client = redis.Redis(host = get_address(), port=os.environ.get("CACHE_PORT", 20320)) logger.error(traceback.format_exc()) return value def set_cache(self, name, value) : try: self.client.set(name = name, value = value) except: self.client = redis.Redis(host = get_address(), port=PORT) logger.error(traceback.format_exc()) def download(self, proto) : try : beg_ts = time() if proto.file_id != '' : keys = proto.file_id else : keys = list(proto.file_id_list) ret = self.get_cache(keys) stat = 'miss' base, url_suffix = get_prefix_suffix(proto) if isinstance(keys, list) and (None in ret): none_index_list, fileids = [], [] for index, val in enumerate(ret) : if val is None : none_index_list.append(index) fileids.append(keys[index]) val_non = download_files(base, fileids, url_suffix) for index, val in zip(none_index_list, val_non): ret[index] = val error_info = 'mget failed, proto : {}, fileids: {}'.format(proto, fileids) logger.error(error_info) elif ret is None: ret = download_by_proto(proto, suffix = url_suffix) if ret is None: ret = download_url(proto.url) else: stat = 'hit' return ret except : error_info = 'Download failed, proto : {}, err: {}'.format(proto, traceback.format_exc()) logger.error(error_info) return None def download_by_url(self, url): try : beg_ts = time() _, file_id = get_bucket_fileid(url) ret = self.get_cache(file_id) if ret is not None : stat = 'hit' else : stat = 'miss' ori_url = url if str(url).count('?imageView2') > 0: url = url[:url.find('?imageView2')] url += '?imageView2/2/w/1080/h/1080/format/webp/q/75' ret = download_cos_url(url) if ret is None: ret = download_url(ori_url) return ret except: error_info = 'download_by_url failed, url : {}, err: {}'.format(url, traceback.format_exc()) logger.error(error_info) return None ===== /workspace/red_serving_py_plugins/MediaIDL/sample/python/client.py ===== import sys import socket import traceback sys.path.append('MediaIDL/python/MediaIDL') from aimedia.modelinterface import AIModelService from aimedia.modelinterface.ttypes import RequestType, ResourceRequest, BizIDRequest from aimedia.modelinterface.ttypes import SourceType as ThriftSourceType from infra.rpc.base.ttypes import Result, Context import logging logger = logging.getLogger(__name__) from time import time, sleep from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol def createThriftClient(port, timeout): transport = TSocket.TSocket("127.0.0.1", port) transport.setTimeout(timeout) transport = TTransport.TFramedTransport(transport) protocol = TBinaryProtocol.TBinaryProtocol(transport) client = AIModelService.Client(protocol) return transport, client def resource_single_image_test(port, image_urls, service_type, request_type): for url in image_urls: # 每个请求单独创建即可,也可以用链接池,需要自己实现,port是server的port,通过mesh转发要用mesh分配映射的 transport, client = createThriftClient(port, 5000) transport.open() caller = "test" # best is your ones service name, Indicate who you are context = Context(baggage={"clientServiceName": caller}) request = ResourceRequest(serviceType=service_type, requestType=request_type, requestData={ "img_url": url, }) print('---------start---------') print(request) res = client.resourceQuery(context, request) print(res) print('---------end------------') transport.close() def bizID_single_image_test(port, service_type, request_type, note_ids): # 每个请求单独创建即可,也可以用链接池,需要自己实现,port是server的port,通过mesh转发要用mesh分配映射的 for note_id in note_ids: transport, client = createThriftClient(port, 10000) transport.open() caller = "test" # best is your ones service name, Indicate who you are context = Context(baggage={"clientServiceName": caller}) request = BizIDRequest(bizID=note_id, serviceType=service_type, sourceType=ThriftSourceType.NOTE, requestType=request_type) print('---------start---------') print(request) res = client.bizIDQuery(context, request) print(res) print('---------end------------') transport.close() if __name__ == '__main__' : # 安审查询接口 # 调试环境 # port = 20230 # mediacpu-modelinterfacebackup-service # 正式接入环境 # port = 20215 # mediacpu-modelinterface-service # 非安审查询接口 # 调试环境 # port = 20822 # mediacpu-modelinterfacebackup-servicev2 # 正式接入环境 # port = 20823 # mediacpu-modelinterface-servicev2 request_type = RequestType.ONLINE_DATA # request_type = RequestType.EXTRA_DATA image_urls = [ 'http://media-keyframe-1251524319.cos.ap-shanghai.myqcloud.com/media/keyframe/capa_v1-p-pre_post/01024m01ks6pc0qa56j0516hdha0yg82qe-363.jpg', # 'http://ci.xiaohongshu.com/01025a01ks5bsptx50l010z8syhc6u8eei?imageView2/2/w/1080/format/jpg', # 'http://ci.xiaohongshu.com/01025a01kt4nf0oxprw010zcplc0m8v33z?imageView2/2/w/1080/format/jpg' ] # 请根据接入文档设置正确的serviceType # service_type = 'tech_cv_general_ocr_v1' # service_type = 'tech_cv_general_ocr_unsafe_v1' resource_single_image_test(port, image_urls, service_type, request_type) note_ids = [ "626296ee0000000001024f3b", "60234391c000000002103c250", # "62287a000000000001026f97" ] bizID_single_image_test(port, service_type, request_type, note_ids) ===== /workspace/red_serving_py_plugins/MediaIDL/sample/python/server.py ===== import os import sys import time sys.path.append('MediaIDL/python/MediaIDL') from proto_to_thrift_model_interface import convertProto2BizIDResponseThrift from proto_to_thrift_model_interface import convertProto2ResourceResponseThrift from proto_to_thrift_model_interface import resource_pb_to_thrift from proto_to_thrift_model_interface import bizID_pb_to_thrift from model_interface_pb2 import BizIDResponse as pb_BizIDResponse from model_interface_pb2 import ResourceResponse as pb_ResourceResponse from aimedia.modelinterface import AIModelService from aimedia.modelinterface.ttypes import BizIDResponse, ResourceResponse, ModelStatus, RequestType, BizIDRequest, ResourceRequest from infra.rpc.base.ttypes import Result from MediaThrift import MediaThriftService from inference import YourNiubilityClass # es 日志保存 from OnlineLogger import OnlineLogger # 普罗米修斯打点 import MetricLogger class MediaHandler(object): def __init__(self, logger, metricLogger): self.logger = logger self.metricLogger = metricLogger self.online_logger = OnlineLogger() # 模型推理函数 self.handler = YourNiubilityClass() def ping(self): return True # bizIDQuery和resourceQuery通常需要算法只实现一个即可 def bizIDQuery(self, context, bizIDRequest): self.metricLogger.sendCounter({'counter': 1}, tags = {'query_type':'bizIDQuery', 'type' : 'success'}) start = time.time() try: resp_data = self.handler.inference(bizIDRequest) # 将resp_data赋值到BizIDResponse中对应的位置 resp = BizIDResponse(Result(success=True, code=0, message='success')) except: self.metricLogger.sendCounter({'counter': 1}, tags = {'query_type':'bizIDQuery', 'type' : 'failed'}) self.online_logger.upload_log(body={'service': 'bizIDQuery', 'bizIDRequest': str(bizIDRequest), 'info': traceback.format_exc()}) self.logger.error(traceback.format_exc()) finally: metric_logger.sendValue({'latency': round(time.time() - start, 4)}, tags = {'query_type':'bizIDQuery', 'type' :'rpc'}) return resp def resourceQuery(self, context, resourceRequest): self.metricLogger.sendCounter({'counter': 1}, tags = {'query_type':'resourceQuery', 'type' : 'success'}) start = time.time() try: resp_data = self.handler.inference(resourceRequest) # 将resp_data赋值到ResourceResponse中对应的位置 resp = ResourceResponse(Result(success=True, code=0, message='success')) except: self.metricLogger.sendCounter({'counter': 1}, tags = {'query_type':'resourceQuery', 'type' : 'failed'}) self.online_logger.upload_log(body={'service': 'resourceQuery', 'resourceRequest': str(resourceRequest), 'info': traceback.format_exc()}) self.logger.error(traceback.format_exc()) finally: metric_logger.sendValue({'latency': round(time.time() - start, 4)}, tags = {'query_type':'resourceQuery', 'type' :'rpc'}) return resp if __name__ == '__main__': metricLogger = MetricLogger.MetricLogger("your_service_name", "your_name") # 初始化日志 log_dir = './log/' log_name = '{}.log'.format(datetime.now().strftime('%Y%m%d-%H%M%S')) logger = get_new_logger(log_dir, log_name, True) logger.info('Starting the server...') # === thrift ip and port ==== thrift_agent = ni.ifaddresses('eth0')[ni.AF_INET][0]['addr'] thrift_port = 8080 logger.info("thrift_agent={}, thrift_port={}".format(thrift_agent, thrift_port)) handler = RPCHandler(logger, metricLogger) processor = AIModelService.Processor(handler) # 依据算法处理能力设置,64意味同时可以处理64路请求 server_thread = 64 server = MediaThriftService.MediaThriftServer(processor,thrift_agent,thrift_port,server_thread, "your_service_name", "your_name", maximum_connection=2048) try: server.run() except: logger.error(traceback.format_exc()) finally: logger.info('Server stoped...') logger.error(traceback.format_exc()) ===== /workspace/red_serving_py_plugins/MediaIDL/sample/python/inference.py ===== sys.path.append('MediaIDL/python/MediaIDL') from model_interface_pb2 import BizIDResponse as pb_BizIDResponse from model_interface_pb2 import ResourceResponse as pb_ResourceResponse class YourNiubilityClass(object) : def __init__(self): # your code init self.sample_model = "" def inference(self, req_data) : try : np_output = self.sample_model.forward(img) return np_output[0][0] except : print('ERROR : ') print(traceback.format_exc()) return None ===== /workspace/red_serving_py_plugins/MediaIDL/sample/python/log.py ===== import os import logging from logging.handlers import TimedRotatingFileHandler from cosuploader import cos_upload_file from misc import get_host_name def get_new_logger(log_dir, log_name, stream_flag=False): if not os.path.exists(log_dir): print("[LOG_INFO_SERVER] Buid new log dir:%s"%log_dir) os.makedirs(log_dir) log_file_path = '%s/%s'%(log_dir, log_name) print("[LOG_INFO_SERVER] log_file_path:%s"%log_file_path) logger = logging.getLogger(log_name) logger.setLevel(logging.INFO) formatter = logging.Formatter( '[LOG_INFO_SERVER] %(asctime)s - %(levelname)s: - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') fh = TimedRotatingFileHandler(filename=log_file_path, when="D", interval=1, backupCount=10) fh.setLevel(logging.INFO) fh.setFormatter(formatter) ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(formatter) if stream_flag: logger.addHandler(ch) logger.addHandler(fh) return logger def upload_logFolder(logFolder, cos_dst): cos_upload_path = cos_dst hostname = get_host_name() for root, dirs, files in os.walk(logFolder): for file in files: filepath = os.path.join(root, file) cos_upload_dst = os.path.join(cos_upload_path, hostname + '_' + file) cos_upload_file(filepath, cos_upload_dst) ===== /workspace/red_serving_py_plugins/MediaIDL/proto/proto_to_thrift_model_interface.py ===== from model_interface_pb2 import BizIDResponse as pb_BizIDResponse from model_interface_pb2 import BizIDResult as pb_BizIDResult from model_interface_pb2 import ResourceResponse as pb_ResourceResponse from model_interface_pb2 import ResourceResult as pb_ResourceResult from model_interface_pb2 import ModelStatus as pb_ModelStatus from model_interface_pb2 import ModelResultInfo as pb_ModelResultInfo from model_interface_pb2 import LabelResponse as pb_LabelResponse from model_interface_pb2 import DetectResponse as pb_DetectResponse from model_interface_pb2 import Coordinate as pb_Coordinate from model_interface_pb2 import LabelInfo as pb_LabelInfo from model_interface_pb2 import FeatureInfo as pb_FeatureInfo from model_interface_pb2 import DetectInfo as pb_DetectInfo from aimedia.modelinterface.ttypes import BizIDResponse as thrift_BizIDResponse from aimedia.modelinterface.ttypes import BizIDResult as thrift_BizIDResult from aimedia.modelinterface.ttypes import ResourceResponse as thrift_ResourceResponse from aimedia.modelinterface.ttypes import ResourceResult as thrift_ResourceResult from aimedia.modelinterface.ttypes import ModelResultInfo as thrift_ModelResultInfo from aimedia.modelinterface.ttypes import LabelResponse as thrift_LabelResponse from aimedia.modelinterface.ttypes import DetectResponse as thrift_DetectResponse from aimedia.modelinterface.ttypes import Coordinate as thrift_Coordinate from aimedia.modelinterface.ttypes import LabelInfo as thrift_LabelInfo from aimedia.modelinterface.ttypes import FeatureInfo as thrift_FeatureInfo from aimedia.modelinterface.ttypes import DetectInfo as thrift_DetectInfo from aimedia.modelinterface.ttypes import AreaInfo as thrift_AreaInfo from aimedia.modelinterface.ttypes import TextOffset as thrift_TextOffset from infra.rpc.base.ttypes import Result def convertLabelResponse(proto_label_response): tf_label_response = thrift_LabelResponse() tf_label_response.status = convertModelStatus(proto_label_response.status) tf_label_response.labelInfos = convertLabelInfos(proto_label_response.labelInfos) tf_label_response.featureInfos = convertFeatureInfos(proto_label_response.featureInfos) return tf_label_response def convertDetectResponse(proto_detect_response): tf_detect_response = thrift_DetectResponse() tf_detect_response.status = convertModelStatus(proto_detect_response.status) tf_detect_response.detectInfos = convertDetectInfos(proto_detect_response.detectInfos) return tf_detect_response def convertModelStatus(proto_cv_status): return proto_cv_status def convertCoordinate(proto_coordinate): tf_coordinate = thrift_Coordinate(proto_coordinate.x, proto_coordinate.y) return tf_coordinate def convertAreaInfo(proto_areaInfo): tf_areaInfo = thrift_AreaInfo(proto_areaInfo.areaRatio, proto_areaInfo.width, proto_areaInfo.height) return tf_areaInfo def convertTextOffset(proto_textOffset): tf_textOffset = thrift_TextOffset(proto_textOffset.text, proto_textOffset.offset, proto_textOffset.length) return tf_textOffset def convertLabelInfos(proto_label_infos): return [thrift_LabelInfo(info.labelID, info.labelName, info.score, info.info, info.parrentLabelID, info.parrentLabelName) for info in proto_label_infos] def convertFeatureInfos(proto_feature_infos): return [thrift_FeatureInfo(info.featureID, info.featureName, info.score, info.info, info.parrentFeatureID, info.parrentFeatureName) for info in proto_feature_infos] def convertDetectInfos(proto_detect_infos): tf_detectInfos = [] for detectInfo in proto_detect_infos: tf_det_info = thrift_DetectInfo() tf_det_info.instanceIndex = detectInfo.instanceIndex tf_det_info.score = detectInfo.score tf_det_info.coordinates = [convertCoordinate(coord) for coord in detectInfo.coordinates] tf_det_info.labelInfos = convertLabelInfos(detectInfo.labelInfos) tf_det_info.instanceName = detectInfo.instanceName tf_det_info.textOffset = convertTextOffset(detectInfo.textOffset) tf_det_info.areaInfo = convertAreaInfo(detectInfo.areaInfo) tf_detectInfos.append(tf_det_info) return tf_detectInfos # def convertArrayInfo(arrayInfos): # arrayInfo = [] # for info in arrayInfos: # arrayInfo.append(info) # return arrayInfo def convertModelResultInfo(model_result_info): tf_model_result = thrift_ModelResultInfo() tf_model_result.sourceType = model_result_info.sourceType tf_model_result.label = model_result_info.label tf_model_result.score = model_result_info.score if model_result_info.HasField('labelResponse'): tf_model_result.labelResponse = convertLabelResponse(model_result_info.labelResponse) if model_result_info.HasField('detectResponse'): tf_model_result.detectResponse = convertDetectResponse(model_result_info.detectResponse) # tf_model_result.arrayInfo = convertArrayInfo(model_result_info.arrayInfo) return tf_model_result def convertExtraInfo(extra_infos): extra_info = [] for info in extra_infos: extra_info.append(info) return extra_info def convertBizIDResult(bizId_result): tf_bizID_result = thrift_BizIDResult() tf_bizID_result.modelStatus = convertModelStatus(bizId_result.modelStatus) tf_bizID_result.label = bizId_result.label tf_bizID_result.score = bizId_result.score tf_bizID_result.extraInfo = convertExtraInfo(bizId_result.extraInfo) model_result_list = [] for model_result in bizId_result.modelResult: model_result_list.append(convertModelResultInfo(model_result)) tf_bizID_result.modelResult = model_result_list return tf_bizID_result def convertResourceResult(resource_result): tf_resource_result = thrift_ResourceResult() tf_resource_result.modelStatus = convertModelStatus(resource_result.modelStatus) tf_resource_result.extraInfo = convertExtraInfo(resource_result.extraInfo) if resource_result.HasField('modelResult'): tf_resource_result.modelResult = convertModelResultInfo(resource_result.modelResult) return tf_resource_result #input: proto_msg, is a de-seralized proto object #output: is a thrift object def convertProto2BizIDResponseThrift(proto_msg): res = thrift_BizIDResponse() if proto_msg.HasField('bizIdResult'): res.bizIdResult = convertBizIDResult(proto_msg.bizIdResult) return res def convertProto2ResourceResponseThrift(proto_msg): res = thrift_ResourceResponse() if proto_msg.HasField('resourceResult'): res.resourceResult = convertResourceResult(proto_msg.resourceResult) return res def resource_pb_to_thrift(): proto_msg = pb_ResourceResponse() proto_msg.resourceResult.modelStatus = pb_ModelStatus.SUCCEED_HIT # proto_msg.resourceResult.extraInfo.append("test1") # proto_msg.resourceResult.extraInfo.append("test2") # proto_msg.resourceResult.modelResult.sourceType = "baokong" proto_msg.resourceResult.modelResult.label = "群众游行" proto_msg.resourceResult.modelResult.score = 0.987 proto_msg.resourceResult.modelResult.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo0 = pb_LabelInfo() labelInfo0.labelID = 0 labelInfo0.labelName = "打架" labelInfo0.score = 0.6 labelInfo0.info = 'test_3' proto_msg.resourceResult.modelResult.labelResponse.labelInfos.append(labelInfo0) featureInfo0 = pb_FeatureInfo() featureInfo0.featureID = 100 featureInfo0.featureName = "dajiadouou" featureInfo0.score = 0.99999 featureInfo0.info = 'test000007' proto_msg.resourceResult.modelResult.labelResponse.featureInfos.append(featureInfo0) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.1) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.2) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.3) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.4) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.5) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.6) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.7) labelInfo1 = pb_LabelInfo() labelInfo1.labelID = 1 labelInfo1.labelName = "聚会" labelInfo1.score = 0.96 labelInfo1.info = 'test_6' labelInfo1.parrentLabelID = 0 labelInfo1.parrentLabelName = 'test_3' proto_msg.resourceResult.modelResult.labelResponse.labelInfos.append(labelInfo1) proto_msg.resourceResult.modelResult.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL detectInfo = pb_DetectInfo() detectInfo.instanceIndex = 3 detectInfo.score = 0.96 coord = pb_Coordinate() coord.x = 23 coord.y = 45 detectInfo.coordinates.append(coord) coord1 = pb_Coordinate() coord1.x = 35 coord1.y = 58 detectInfo.coordinates.append(coord1) label_info2 = pb_LabelInfo() label_info3 = pb_LabelInfo() label_info2.labelID = 5 label_info2.labelName = "5" label_info2.score = 0.33 label_info2.info = '234' label_info3.labelID=6 label_info3.labelName = "5" label_info3.score = 0.66 label_info3.info = '456' detectInfo.labelInfos.append(label_info2) detectInfo.labelInfos.append(label_info3) detectInfo.instanceName = "hahahahahaha" detectInfo.textOffset.text = "textoffset" detectInfo.textOffset.offset = 12 detectInfo.textOffset.length = 6 detectInfo.areaInfo.areaRatio = 0.2 detectInfo.areaInfo.width = 11000 detectInfo.areaInfo.height = 22222 proto_msg.resourceResult.modelResult.detectResponse.detectInfos.append(detectInfo) thrift_resp = convertProto2ResourceResponseThrift(proto_msg) thrift_resp.result = Result(success=True, code=0, message="Success") return thrift_resp def bizID_pb_to_thrift(): proto_msg = pb_BizIDResponse() proto_msg.bizIdResult.modelStatus = pb_ModelStatus.SUCCEED_NORMAL proto_msg.bizIdResult.extraInfo.append("test1") proto_msg.bizIdResult.extraInfo.append("test2") proto_msg.bizIdResult.label = "kongbuxiji" proto_msg.bizIdResult.score = 90 model_result0 = pb_ModelResultInfo() model_result0.sourceType = "baokong" model_result0.label = "xizangdaza" model_result0.score = 89.5 model_result0.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo0 = pb_LabelInfo() labelInfo0.labelID = 0 labelInfo0.labelName = "0" labelInfo0.score = 0.6 labelInfo0.info = 'test_4' model_result0.labelResponse.labelInfos.append(labelInfo0) labelInfo1 = pb_LabelInfo() labelInfo1.labelID = 1 labelInfo1.labelName = "1" labelInfo1.score = 0.8 labelInfo1.info = 'test_5' model_result0.labelResponse.labelInfos.append(labelInfo1) model_result0.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL detectInfo = pb_DetectInfo() detectInfo.instanceIndex = 3 detectInfo.score = 0.96 coord = pb_Coordinate() coord.x = 23 coord.y = 45 detectInfo.coordinates.append(coord) coord1 = pb_Coordinate() coord1.x = 35 coord1.y = 58 detectInfo.coordinates.append(coord1) label_info2 = pb_LabelInfo() label_info3 = pb_LabelInfo() label_info2.labelID = 5 label_info2.labelName = "5" label_info2.score = 0.33 label_info2.info = '234' label_info3.labelID=6 label_info3.labelName = "5" label_info3.score = 0.66 label_info3.info = '456' detectInfo.labelInfos.append(label_info2) detectInfo.labelInfos.append(label_info3) model_result0.detectResponse.detectInfos.append(detectInfo) proto_msg.bizIdResult.modelResult.append(model_result0) model_result1 = pb_ModelResultInfo() model_result1.sourceType = "baokong" model_result1.label = "dongtu" model_result1.score = 89.7 model_result1.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL model_result1.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo2 = pb_LabelInfo() labelInfo2.labelID = 2 labelInfo2.labelName = "2" labelInfo2.score = 0.6 labelInfo2.info = 'test_6' model_result1.labelResponse.labelInfos.append(labelInfo2) proto_msg.bizIdResult.modelResult.append(model_result1) #input is a deseralized proto message thrift_resp = convertProto2BizIDResponseThrift(proto_msg) thrift_resp.result = Result(success=True, code=0, message="Success") return thrift_resp if __name__ == '__main__': thrift_resp = resource_pb_to_thrift() print("-------ResourceResponse----------") print(thrift_resp) #input is a deseralized proto message print(thrift_resp.resourceResult.modelStatus) for i in range(len(thrift_resp.resourceResult.extraInfo)): print(thrift_resp.resourceResult.extraInfo[i]) print(thrift_resp.resourceResult.modelResult.sourceType) print(thrift_resp.resourceResult.modelResult.label) print(thrift_resp.resourceResult.modelResult.score) # for i in range(len(thrift_resp.resourceResult.modelResult.arrayInfo)): # print(thrift_resp.resourceResult.modelResult.arrayInfo[i]) print("-------分类,多标签详细结果----------") print(thrift_resp.resourceResult.modelResult.labelResponse.status) for i in range(len(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos)): print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].labelID) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].labelName) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].score) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].info) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].featureID) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].featureName) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].score) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].info) print("-------检测等详细结果----------") print(thrift_resp.resourceResult.modelResult.detectResponse.status) for i in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].instanceIndex) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].score) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].instanceName) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].textOffset) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].areaInfo) for j in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates[j].x) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates[j].y) for k in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[0].labelInfos)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].labelID) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].labelName) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].score) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].info) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].parrentLabelID) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].parrentLabelName) print("-------BizId Response----------") thrift_resp = bizID_pb_to_thrift() print(thrift_resp) print(thrift_resp.bizIdResult.modelStatus) print(thrift_resp.bizIdResult.label) print(thrift_resp.bizIdResult.score) for i in range(len(thrift_resp.bizIdResult.extraInfo)): print(thrift_resp.bizIdResult.extraInfo[i]) for h in range(len(thrift_resp.bizIdResult.modelResult)): print(thrift_resp.bizIdResult.modelResult[h].sourceType) print(thrift_resp.bizIdResult.modelResult[h].label) print(thrift_resp.bizIdResult.modelResult[h].score) print("-------分类,多标签详细结果----------") print(thrift_resp.bizIdResult.modelResult[h].labelResponse.status) for i in range(len(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos)): print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].labelID) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].labelName) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].score) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].info) print("-------检测等详细结果----------") print(thrift_resp.bizIdResult.modelResult[h].detectResponse.status) for i in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].instanceIndex) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].score) for j in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates[j].x) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates[j].y) for k in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[0].labelInfos)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].labelID) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].labelName) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].score) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].info) ===== /workspace/red_serving_py_plugins/MediaIDL/proto/proto_to_thrift.py ===== from cv_task_pb2 import CVResponse as pb_CVResponse from cv_task_pb2 import CVStatus as pb_CVStatus from cv_task_pb2 import LabelResponse as pb_LabelResponse from cv_task_pb2 import DetectResponse as pb_DetectResponse from cv_task_pb2 import Coordinate as pb_Coordinate from cv_task_pb2 import LabelInfo as pb_LabelInfo from cv_task_pb2 import DetectInfo as pb_DetectInfo from aimedia.cvtask.ttypes import CVResponse as thrift_CVResponse from aimedia.cvtask.ttypes import CVStatus as thrift_CVStatus from aimedia.cvtask.ttypes import LabelResponse as thrift_LabelResponse from aimedia.cvtask.ttypes import DetectResponse as thrift_DetectResponse from aimedia.cvtask.ttypes import Coordinate as thrift_Coordinate from aimedia.cvtask.ttypes import LabelInfo as thrift_LabelInfo from aimedia.cvtask.ttypes import DetectInfo as thrift_DetectInfo def convertLabelResponse(proto_label_response): tf_label_response = thrift_LabelResponse() tf_label_response.status = convertCVStatus(proto_label_response.result_status) tf_label_response.label_infos = convertLabelInfos(proto_label_response.label_infos) return tf_label_response def convertDetectResponse(proto_detect_response): tf_detect_response = thrift_DetectResponse() tf_detect_response.status = convertCVStatus(proto_detect_response.result_status) tf_detect_response.detect_infos = convertDetectInfos(proto_detect_response.detect_infos) return tf_detect_response def convertCVStatus(proto_cv_status): return proto_cv_status def convertCoordinate(proto_coordinate): tf_coordinate = thrift_Coordinate(proto_coordinate.x, proto_coordinate.y) return tf_coordinate def convertLabelInfos(proto_label_infos): return [thrift_LabelInfo(info.label, info.score, info.info) for info in proto_label_infos] def convertDetectInfos(proto_detect_infos): tf_detectInfos = [] for detectInfo in proto_detect_infos: tf_det_info = thrift_DetectInfo() tf_det_info.instance_index = detectInfo.instance_index tf_det_info.score = detectInfo.score tf_det_info.coordinates = [convertCoordinate(coord) for coord in detectInfo.coordinates] tf_det_info.label_infos = convertLabelInfos(detectInfo.label_infos) tf_detectInfos.append(tf_det_info) return tf_detectInfos def convertProto2Thrift(proto_msg): #input: proto_msg, is a de-seralized proto object #output: is a thrift object res = thrift_CVResponse() if proto_msg.HasField('label_response'): res.label_response = convertLabelResponse(proto_msg.label_response) if proto_msg.HasField('detect_response'): res.detect_response = convertDetectResponse(proto_msg.detect_response) return res if __name__ == '__main__': proto_msg = pb_CVResponse() proto_msg.label_response.result_status = pb_CVStatus.ERROR_MODEL_INFERENCE labelInfo = proto_msg.label_response.label_infos.add() labelInfo.label = 309 labelInfo.score = 0.6 labelInfo.info = 'test_3' labelInfo1 = proto_msg.label_response.label_infos.add() labelInfo1.label = 3096 labelInfo1.score = 0.96 labelInfo1.info = 'test_6' proto_msg.detect_response.result_status = pb_CVStatus.SUCCEED_NORMAL detectInfo = proto_msg.detect_response.detect_infos.add() detectInfo.instance_index = 3 detectInfo.score = 0.96 coord = detectInfo.coordinates.add() coord.x = 0.5 coord.y = 0.5 coord1 = detectInfo.coordinates.add() coord1.x = 0.8 coord1.y = 0.8 label_info2 = detectInfo.label_infos.add() label_info3 = detectInfo.label_infos.add() label_info2.label = 5 label_info2.score = 0.33 label_info2.info = '234' label_info3.label=6 label_info3.score = 0.66 #input is a deseralized proto message thrift_resp = convertProto2Thrift(proto_msg) print(thrift_resp.detect_response.status) print(thrift_resp.detect_response.detect_infos[0].instance_index) print(thrift_resp.detect_response.detect_infos[0].score) print(thrift_resp.detect_response.detect_infos[0].coordinates[0].x) print(thrift_resp.detect_response.detect_infos[0].coordinates[0].y) print(thrift_resp.detect_response.detect_infos[0].coordinates[1].x) print(thrift_resp.detect_response.detect_infos[0].coordinates[1].y) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].label) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].score) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].info) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].label) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].score) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].info) ===== /workspace/red_serving_py_plugins/MediaIDL/proto/proto_to_thrift_ocr.py ===== from ocr_task_pb2 import CVResponse as pb_CVResponse from ocr_task_pb2 import CVStatus as pb_CVStatus from ocr_task_pb2 import LabelResponse as pb_LabelResponse from ocr_task_pb2 import DetectResponse as pb_DetectResponse from ocr_task_pb2 import Coordinate as pb_Coordinate from ocr_task_pb2 import LabelInfo as pb_LabelInfo from ocr_task_pb2 import DetectInfo as pb_DetectInfo from aimedia.ocrtask.ttypes import CVResponse as thrift_CVResponse from aimedia.ocrtask.ttypes import CVStatus as thrift_CVStatus from aimedia.ocrtask.ttypes import LabelResponse as thrift_LabelResponse from aimedia.ocrtask.ttypes import DetectResponse as thrift_DetectResponse from aimedia.ocrtask.ttypes import Coordinate as thrift_Coordinate from aimedia.ocrtask.ttypes import LabelInfo as thrift_LabelInfo from aimedia.ocrtask.ttypes import DetectInfo as thrift_DetectInfo def convertLabelResponse(proto_label_response): tf_label_response = thrift_LabelResponse() tf_label_response.status = convertCVStatus(proto_label_response.result_status) tf_label_response.label_infos = convertLabelInfos(proto_label_response.label_infos) return tf_label_response def convertDetectResponse(proto_detect_response): tf_detect_response = thrift_DetectResponse() tf_detect_response.status = convertCVStatus(proto_detect_response.result_status) tf_detect_response.detect_infos = convertDetectInfos(proto_detect_response.detect_infos) return tf_detect_response def convertCVStatus(proto_cv_status): return proto_cv_status def convertCoordinate(proto_coordinate): tf_coordinate = thrift_Coordinate(proto_coordinate.x, proto_coordinate.y) return tf_coordinate def convertLabelInfos(proto_label_infos): return [thrift_LabelInfo(info.label, info.score, info.info) for info in proto_label_infos] def convertDetectInfos(proto_detect_infos): tf_detectInfos = [] for detectInfo in proto_detect_infos: tf_det_info = thrift_DetectInfo() tf_det_info.instance_index = detectInfo.instance_index tf_det_info.score = detectInfo.score tf_det_info.coordinates = [convertCoordinate(coord) for coord in detectInfo.coordinates] tf_det_info.label_infos = convertLabelInfos(detectInfo.label_infos) tf_detectInfos.append(tf_det_info) return tf_detectInfos def convertProto2Thrift(proto_msg): #input: proto_msg, is a de-seralized proto object #output: is a thrift object res = thrift_CVResponse() if proto_msg.HasField('label_response'): res.label_response = convertLabelResponse(proto_msg.label_response) if proto_msg.HasField('detect_response'): res.detect_response = convertDetectResponse(proto_msg.detect_response) return res if __name__ == '__main__': proto_msg = pb_CVResponse() proto_msg.label_response.result_status = pb_CVStatus.ERROR_MODEL_INFERENCE labelInfo = proto_msg.label_response.label_infos.add() labelInfo.label = 309 labelInfo.score = 0.6 labelInfo.info = 'test_3' labelInfo1 = proto_msg.label_response.label_infos.add() labelInfo1.label = 3096 labelInfo1.score = 0.96 labelInfo1.info = 'test_6' proto_msg.detect_response.result_status = pb_CVStatus.SUCCEED_NORMAL detectInfo = proto_msg.detect_response.detect_infos.add() detectInfo.instance_index = 3 detectInfo.score = 0.96 coord = detectInfo.coordinates.add() coord.x = 0.5 coord.y = 0.5 coord1 = detectInfo.coordinates.add() coord1.x = 0.8 coord1.y = 0.8 label_info2 = detectInfo.label_infos.add() label_info3 = detectInfo.label_infos.add() label_info2.label = 5 label_info2.score = 0.33 label_info2.info = '234' label_info3.label=6 label_info3.score = 0.66 #input is a deseralized proto message thrift_resp = convertProto2Thrift(proto_msg) print(thrift_resp.detect_response.status) print(thrift_resp.detect_response.detect_infos[0].instance_index) print(thrift_resp.detect_response.detect_infos[0].score) print(thrift_resp.detect_response.detect_infos[0].coordinates[0].x) print(thrift_resp.detect_response.detect_infos[0].coordinates[0].y) print(thrift_resp.detect_response.detect_infos[0].coordinates[1].x) print(thrift_resp.detect_response.detect_infos[0].coordinates[1].y) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].label) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].score) print(thrift_resp.detect_response.detect_infos[0].label_infos[0].info) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].label) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].score) print(thrift_resp.detect_response.detect_infos[0].label_infos[1].info) ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/proto_to_thrift_model_interface.py ===== from model_interface_pb2 import BizIDResponse as pb_BizIDResponse from model_interface_pb2 import BizIDResult as pb_BizIDResult from model_interface_pb2 import ResourceResponse as pb_ResourceResponse from model_interface_pb2 import ResourceResult as pb_ResourceResult from model_interface_pb2 import ModelStatus as pb_ModelStatus from model_interface_pb2 import ModelResultInfo as pb_ModelResultInfo from model_interface_pb2 import LabelResponse as pb_LabelResponse from model_interface_pb2 import DetectResponse as pb_DetectResponse from model_interface_pb2 import Coordinate as pb_Coordinate from model_interface_pb2 import LabelInfo as pb_LabelInfo from model_interface_pb2 import FeatureInfo as pb_FeatureInfo from model_interface_pb2 import DetectInfo as pb_DetectInfo from aimedia.modelinterface.ttypes import BizIDResponse as thrift_BizIDResponse from aimedia.modelinterface.ttypes import BizIDResult as thrift_BizIDResult from aimedia.modelinterface.ttypes import ResourceResponse as thrift_ResourceResponse from aimedia.modelinterface.ttypes import ResourceResult as thrift_ResourceResult from aimedia.modelinterface.ttypes import ModelResultInfo as thrift_ModelResultInfo from aimedia.modelinterface.ttypes import LabelResponse as thrift_LabelResponse from aimedia.modelinterface.ttypes import DetectResponse as thrift_DetectResponse from aimedia.modelinterface.ttypes import Coordinate as thrift_Coordinate from aimedia.modelinterface.ttypes import LabelInfo as thrift_LabelInfo from aimedia.modelinterface.ttypes import FeatureInfo as thrift_FeatureInfo from aimedia.modelinterface.ttypes import DetectInfo as thrift_DetectInfo from aimedia.modelinterface.ttypes import AreaInfo as thrift_AreaInfo from aimedia.modelinterface.ttypes import TextOffset as thrift_TextOffset from infra.rpc.base.ttypes import Result def convertLabelResponse(proto_label_response): tf_label_response = thrift_LabelResponse() tf_label_response.status = convertModelStatus(proto_label_response.status) tf_label_response.labelInfos = convertLabelInfos(proto_label_response.labelInfos) tf_label_response.featureInfos = convertFeatureInfos(proto_label_response.featureInfos) return tf_label_response def convertDetectResponse(proto_detect_response): tf_detect_response = thrift_DetectResponse() tf_detect_response.status = convertModelStatus(proto_detect_response.status) tf_detect_response.detectInfos = convertDetectInfos(proto_detect_response.detectInfos) return tf_detect_response def convertModelStatus(proto_cv_status): return proto_cv_status def convertCoordinate(proto_coordinate): tf_coordinate = thrift_Coordinate(proto_coordinate.x, proto_coordinate.y) return tf_coordinate def convertAreaInfo(proto_areaInfo): tf_areaInfo = thrift_AreaInfo(proto_areaInfo.areaRatio, proto_areaInfo.width, proto_areaInfo.height) return tf_areaInfo def convertTextOffset(proto_textOffset): tf_textOffset = thrift_TextOffset(proto_textOffset.text, proto_textOffset.offset, proto_textOffset.length) return tf_textOffset def convertLabelInfos(proto_label_infos): return [thrift_LabelInfo(info.labelID, info.labelName, info.score, info.info, info.parrentLabelID, info.parrentLabelName) for info in proto_label_infos] def convertFeatureInfos(proto_feature_infos): return [thrift_FeatureInfo(info.featureID, info.featureName, info.score, info.info, info.parrentFeatureID, info.parrentFeatureName) for info in proto_feature_infos] def convertDetectInfos(proto_detect_infos): tf_detectInfos = [] for detectInfo in proto_detect_infos: tf_det_info = thrift_DetectInfo() tf_det_info.instanceIndex = detectInfo.instanceIndex tf_det_info.score = detectInfo.score tf_det_info.coordinates = [convertCoordinate(coord) for coord in detectInfo.coordinates] tf_det_info.labelInfos = convertLabelInfos(detectInfo.labelInfos) tf_det_info.instanceName = detectInfo.instanceName tf_det_info.textOffset = convertTextOffset(detectInfo.textOffset) tf_det_info.areaInfo = convertAreaInfo(detectInfo.areaInfo) tf_detectInfos.append(tf_det_info) return tf_detectInfos # def convertArrayInfo(arrayInfos): # arrayInfo = [] # for info in arrayInfos: # arrayInfo.append(info) # return arrayInfo def convertModelResultInfo(model_result_info): tf_model_result = thrift_ModelResultInfo() tf_model_result.sourceType = model_result_info.sourceType tf_model_result.label = model_result_info.label tf_model_result.score = model_result_info.score if model_result_info.HasField('labelResponse'): tf_model_result.labelResponse = convertLabelResponse(model_result_info.labelResponse) if model_result_info.HasField('detectResponse'): tf_model_result.detectResponse = convertDetectResponse(model_result_info.detectResponse) # tf_model_result.arrayInfo = convertArrayInfo(model_result_info.arrayInfo) return tf_model_result def convertExtraInfo(extra_infos): extra_info = [] for info in extra_infos: extra_info.append(info) return extra_info def convertBizIDResult(bizId_result): tf_bizID_result = thrift_BizIDResult() tf_bizID_result.modelStatus = convertModelStatus(bizId_result.modelStatus) tf_bizID_result.label = bizId_result.label tf_bizID_result.score = bizId_result.score tf_bizID_result.extraInfo = convertExtraInfo(bizId_result.extraInfo) model_result_list = [] for model_result in bizId_result.modelResult: model_result_list.append(convertModelResultInfo(model_result)) tf_bizID_result.modelResult = model_result_list return tf_bizID_result def convertResourceResult(resource_result): tf_resource_result = thrift_ResourceResult() tf_resource_result.modelStatus = convertModelStatus(resource_result.modelStatus) tf_resource_result.extraInfo = convertExtraInfo(resource_result.extraInfo) if resource_result.HasField('modelResult'): tf_resource_result.modelResult = convertModelResultInfo(resource_result.modelResult) return tf_resource_result #input: proto_msg, is a de-seralized proto object #output: is a thrift object def convertProto2BizIDResponseThrift(proto_msg): res = thrift_BizIDResponse() if proto_msg.HasField('bizIdResult'): res.bizIdResult = convertBizIDResult(proto_msg.bizIdResult) return res def convertProto2ResourceResponseThrift(proto_msg): res = thrift_ResourceResponse() if proto_msg.HasField('resourceResult'): res.resourceResult = convertResourceResult(proto_msg.resourceResult) return res def resource_pb_to_thrift(): proto_msg = pb_ResourceResponse() proto_msg.resourceResult.modelStatus = pb_ModelStatus.SUCCEED_HIT # proto_msg.resourceResult.extraInfo.append("test1") # proto_msg.resourceResult.extraInfo.append("test2") # proto_msg.resourceResult.modelResult.sourceType = "baokong" proto_msg.resourceResult.modelResult.label = "群众游行" proto_msg.resourceResult.modelResult.score = 0.987 proto_msg.resourceResult.modelResult.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo0 = pb_LabelInfo() labelInfo0.labelID = 0 labelInfo0.labelName = "打架" labelInfo0.score = 0.6 labelInfo0.info = 'test_3' proto_msg.resourceResult.modelResult.labelResponse.labelInfos.append(labelInfo0) featureInfo0 = pb_FeatureInfo() featureInfo0.featureID = 100 featureInfo0.featureName = "dajiadouou" featureInfo0.score = 0.99999 featureInfo0.info = 'test000007' proto_msg.resourceResult.modelResult.labelResponse.featureInfos.append(featureInfo0) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.1) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.2) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.3) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.4) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.5) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.6) # proto_msg.resourceResult.modelResult.arrayInfo.append(1.7) labelInfo1 = pb_LabelInfo() labelInfo1.labelID = 1 labelInfo1.labelName = "聚会" labelInfo1.score = 0.96 labelInfo1.info = 'test_6' labelInfo1.parrentLabelID = 0 labelInfo1.parrentLabelName = 'test_3' proto_msg.resourceResult.modelResult.labelResponse.labelInfos.append(labelInfo1) proto_msg.resourceResult.modelResult.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL detectInfo = pb_DetectInfo() detectInfo.instanceIndex = 3 detectInfo.score = 0.96 coord = pb_Coordinate() coord.x = 23 coord.y = 45 detectInfo.coordinates.append(coord) coord1 = pb_Coordinate() coord1.x = 35 coord1.y = 58 detectInfo.coordinates.append(coord1) label_info2 = pb_LabelInfo() label_info3 = pb_LabelInfo() label_info2.labelID = 5 label_info2.labelName = "5" label_info2.score = 0.33 label_info2.info = '234' label_info3.labelID=6 label_info3.labelName = "5" label_info3.score = 0.66 label_info3.info = '456' detectInfo.labelInfos.append(label_info2) detectInfo.labelInfos.append(label_info3) detectInfo.instanceName = "hahahahahaha" detectInfo.textOffset.text = "textoffset" detectInfo.textOffset.offset = 12 detectInfo.textOffset.length = 6 detectInfo.areaInfo.areaRatio = 0.2 detectInfo.areaInfo.width = 11000 detectInfo.areaInfo.height = 22222 proto_msg.resourceResult.modelResult.detectResponse.detectInfos.append(detectInfo) thrift_resp = convertProto2ResourceResponseThrift(proto_msg) thrift_resp.result = Result(success=True, code=0, message="Success") return thrift_resp def bizID_pb_to_thrift(): proto_msg = pb_BizIDResponse() proto_msg.bizIdResult.modelStatus = pb_ModelStatus.SUCCEED_NORMAL proto_msg.bizIdResult.extraInfo.append("test1") proto_msg.bizIdResult.extraInfo.append("test2") proto_msg.bizIdResult.label = "kongbuxiji" proto_msg.bizIdResult.score = 90 model_result0 = pb_ModelResultInfo() model_result0.sourceType = "baokong" model_result0.label = "xizangdaza" model_result0.score = 89.5 model_result0.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo0 = pb_LabelInfo() labelInfo0.labelID = 0 labelInfo0.labelName = "0" labelInfo0.score = 0.6 labelInfo0.info = 'test_4' model_result0.labelResponse.labelInfos.append(labelInfo0) labelInfo1 = pb_LabelInfo() labelInfo1.labelID = 1 labelInfo1.labelName = "1" labelInfo1.score = 0.8 labelInfo1.info = 'test_5' model_result0.labelResponse.labelInfos.append(labelInfo1) model_result0.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL detectInfo = pb_DetectInfo() detectInfo.instanceIndex = 3 detectInfo.score = 0.96 coord = pb_Coordinate() coord.x = 23 coord.y = 45 detectInfo.coordinates.append(coord) coord1 = pb_Coordinate() coord1.x = 35 coord1.y = 58 detectInfo.coordinates.append(coord1) label_info2 = pb_LabelInfo() label_info3 = pb_LabelInfo() label_info2.labelID = 5 label_info2.labelName = "5" label_info2.score = 0.33 label_info2.info = '234' label_info3.labelID=6 label_info3.labelName = "5" label_info3.score = 0.66 label_info3.info = '456' detectInfo.labelInfos.append(label_info2) detectInfo.labelInfos.append(label_info3) model_result0.detectResponse.detectInfos.append(detectInfo) proto_msg.bizIdResult.modelResult.append(model_result0) model_result1 = pb_ModelResultInfo() model_result1.sourceType = "baokong" model_result1.label = "dongtu" model_result1.score = 89.7 model_result1.labelResponse.status = pb_ModelStatus.SUCCEED_NORMAL model_result1.detectResponse.status = pb_ModelStatus.SUCCEED_NORMAL labelInfo2 = pb_LabelInfo() labelInfo2.labelID = 2 labelInfo2.labelName = "2" labelInfo2.score = 0.6 labelInfo2.info = 'test_6' model_result1.labelResponse.labelInfos.append(labelInfo2) proto_msg.bizIdResult.modelResult.append(model_result1) #input is a deseralized proto message thrift_resp = convertProto2BizIDResponseThrift(proto_msg) thrift_resp.result = Result(success=True, code=0, message="Success") return thrift_resp if __name__ == '__main__': thrift_resp = resource_pb_to_thrift() print("-------ResourceResponse----------") print(thrift_resp) #input is a deseralized proto message print(thrift_resp.resourceResult.modelStatus) for i in range(len(thrift_resp.resourceResult.extraInfo)): print(thrift_resp.resourceResult.extraInfo[i]) print(thrift_resp.resourceResult.modelResult.sourceType) print(thrift_resp.resourceResult.modelResult.label) print(thrift_resp.resourceResult.modelResult.score) # for i in range(len(thrift_resp.resourceResult.modelResult.arrayInfo)): # print(thrift_resp.resourceResult.modelResult.arrayInfo[i]) print("-------分类,多标签详细结果----------") print(thrift_resp.resourceResult.modelResult.labelResponse.status) for i in range(len(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos)): print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].labelID) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].labelName) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].score) print(thrift_resp.resourceResult.modelResult.labelResponse.labelInfos[i].info) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].featureID) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].featureName) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].score) print(thrift_resp.resourceResult.modelResult.labelResponse.featureInfos[i].info) print("-------检测等详细结果----------") print(thrift_resp.resourceResult.modelResult.detectResponse.status) for i in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].instanceIndex) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].score) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].instanceName) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].textOffset) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].areaInfo) for j in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates[j].x) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].coordinates[j].y) for k in range(len(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[0].labelInfos)): print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].labelID) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].labelName) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].score) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].info) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].parrentLabelID) print(thrift_resp.resourceResult.modelResult.detectResponse.detectInfos[i].labelInfos[k].parrentLabelName) print("-------BizId Response----------") thrift_resp = bizID_pb_to_thrift() print(thrift_resp) print(thrift_resp.bizIdResult.modelStatus) print(thrift_resp.bizIdResult.label) print(thrift_resp.bizIdResult.score) for i in range(len(thrift_resp.bizIdResult.extraInfo)): print(thrift_resp.bizIdResult.extraInfo[i]) for h in range(len(thrift_resp.bizIdResult.modelResult)): print(thrift_resp.bizIdResult.modelResult[h].sourceType) print(thrift_resp.bizIdResult.modelResult[h].label) print(thrift_resp.bizIdResult.modelResult[h].score) print("-------分类,多标签详细结果----------") print(thrift_resp.bizIdResult.modelResult[h].labelResponse.status) for i in range(len(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos)): print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].labelID) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].labelName) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].score) print(thrift_resp.bizIdResult.modelResult[h].labelResponse.labelInfos[i].info) print("-------检测等详细结果----------") print(thrift_resp.bizIdResult.modelResult[h].detectResponse.status) for i in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].instanceIndex) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].score) for j in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates[j].x) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].coordinates[j].y) for k in range(len(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[0].labelInfos)): print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].labelID) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].labelName) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].score) print(thrift_resp.bizIdResult.modelResult[h].detectResponse.detectInfos[i].labelInfos[k].info) ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/model_interface_pb2.py ===== # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: model_interface.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='model_interface.proto', package='model_interface', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x15model_interface.proto\x12\x0fmodel_interface\"B\n\rBizIDResponse\x12\x31\n\x0b\x62izIdResult\x18\x01 \x01(\x0b\x32\x1c.model_interface.BizIDResult\"\xa8\x01\n\x0b\x42izIDResult\x12\x31\n\x0bmodelStatus\x18\x01 \x01(\x0e\x32\x1c.model_interface.ModelStatus\x12\x11\n\textraInfo\x18\x02 \x03(\t\x12\r\n\x05label\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x01\x12\x35\n\x0bmodelResult\x18\x05 \x03(\x0b\x32 .model_interface.ModelResultInfo\"K\n\x10ResourceResponse\x12\x37\n\x0eresourceResult\x18\x01 \x01(\x0b\x32\x1f.model_interface.ResourceResult\"\x8d\x01\n\x0eResourceResult\x12\x31\n\x0bmodelStatus\x18\x01 \x01(\x0e\x32\x1c.model_interface.ModelStatus\x12\x11\n\textraInfo\x18\x02 \x03(\t\x12\x35\n\x0bmodelResult\x18\x03 \x01(\x0b\x32 .model_interface.ModelResultInfo\"\xb3\x01\n\x0fModelResultInfo\x12\x12\n\nsourceType\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\r\n\x05score\x18\x03 \x01(\x01\x12\x35\n\rlabelResponse\x18\x04 \x01(\x0b\x32\x1e.model_interface.LabelResponse\x12\x37\n\x0e\x64\x65tectResponse\x18\x05 \x01(\x0b\x32\x1f.model_interface.DetectResponse\"\xa1\x01\n\rLabelResponse\x12,\n\x06status\x18\x01 \x01(\x0e\x32\x1c.model_interface.ModelStatus\x12.\n\nlabelInfos\x18\x02 \x03(\x0b\x32\x1a.model_interface.LabelInfo\x12\x32\n\x0c\x66\x65\x61tureInfos\x18\x03 \x03(\x0b\x32\x1c.model_interface.FeatureInfo\"~\n\tLabelInfo\x12\x0f\n\x07labelID\x18\x01 \x01(\x05\x12\x11\n\tlabelName\x18\x02 \x01(\t\x12\r\n\x05score\x18\x03 \x01(\x01\x12\x0c\n\x04info\x18\x04 \x01(\t\x12\x16\n\x0eparrentLabelID\x18\x05 \x01(\x05\x12\x18\n\x10parrentLabelName\x18\x06 \x01(\t\"\x88\x01\n\x0b\x46\x65\x61tureInfo\x12\x11\n\tfeatureID\x18\x01 \x01(\x05\x12\x13\n\x0b\x66\x65\x61tureName\x18\x02 \x01(\t\x12\r\n\x05score\x18\x03 \x01(\x01\x12\x0c\n\x04info\x18\x04 \x01(\t\x12\x18\n\x10parrentFeatureID\x18\x05 \x01(\x05\x12\x1a\n\x12parrentFeatureName\x18\x06 \x01(\t\"p\n\x0e\x44\x65tectResponse\x12,\n\x06status\x18\x01 \x01(\x0e\x32\x1c.model_interface.ModelStatus\x12\x30\n\x0b\x64\x65tectInfos\x18\x02 \x03(\x0b\x32\x1b.model_interface.DetectInfo\"\x88\x02\n\nDetectInfo\x12\x15\n\rinstanceIndex\x18\x01 \x01(\x05\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x30\n\x0b\x63oordinates\x18\x03 \x03(\x0b\x32\x1b.model_interface.Coordinate\x12.\n\nlabelInfos\x18\x04 \x03(\x0b\x32\x1a.model_interface.LabelInfo\x12\x14\n\x0cinstanceName\x18\x05 \x01(\t\x12/\n\ntextOffset\x18\x06 \x01(\x0b\x32\x1b.model_interface.TextOffset\x12+\n\x08\x61reaInfo\x18\x07 \x01(\x0b\x32\x19.model_interface.AreaInfo\"\"\n\nCoordinate\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\":\n\nTextOffset\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\x0e\n\x06length\x18\x03 \x01(\x05\"<\n\x08\x41reaInfo\x12\x11\n\tareaRatio\x18\x01 \x01(\x01\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05*\xd8\x01\n\x0bModelStatus\x12\x12\n\x0eSUCCEED_NORMAL\x10\x00\x12\x0f\n\x0bSUCCEED_HIT\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x08\n\x04\x46\x41IL\x10\x03\x12\x10\n\x0c\x45RROR_UKNOWN\x10\x64\x12\x16\n\x12\x45RROR_URL_DOWNLOAD\x10\x65\x12\x14\n\x10\x45RROR_DB_RED_KEY\x10\x66\x12\x11\n\x0c\x45RROR_CV_ERR\x10\xd9\x04\x12\x1b\n\x16\x45RROR_IMAGE_PREPROCESS\x10\xda\x04\x12\x1a\n\x15\x45RROR_MODEL_INFERENCE\x10\xdb\x04\x62\x06proto3' ) _MODELSTATUS = _descriptor.EnumDescriptor( name='ModelStatus', full_name='model_interface.ModelStatus', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SUCCEED_NORMAL', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SUCCEED_HIT', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROCESSING', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FAIL', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_UKNOWN', index=4, number=100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_URL_DOWNLOAD', index=5, number=101, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_DB_RED_KEY', index=6, number=102, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_CV_ERR', index=7, number=601, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_IMAGE_PREPROCESS', index=8, number=602, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_MODEL_INFERENCE', index=9, number=603, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=1655, serialized_end=1871, ) _sym_db.RegisterEnumDescriptor(_MODELSTATUS) ModelStatus = enum_type_wrapper.EnumTypeWrapper(_MODELSTATUS) SUCCEED_NORMAL = 0 SUCCEED_HIT = 1 PROCESSING = 2 FAIL = 3 ERROR_UKNOWN = 100 ERROR_URL_DOWNLOAD = 101 ERROR_DB_RED_KEY = 102 ERROR_CV_ERR = 601 ERROR_IMAGE_PREPROCESS = 602 ERROR_MODEL_INFERENCE = 603 _BIZIDRESPONSE = _descriptor.Descriptor( name='BizIDResponse', full_name='model_interface.BizIDResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='bizIdResult', full_name='model_interface.BizIDResponse.bizIdResult', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=42, serialized_end=108, ) _BIZIDRESULT = _descriptor.Descriptor( name='BizIDResult', full_name='model_interface.BizIDResult', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='modelStatus', full_name='model_interface.BizIDResult.modelStatus', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='extraInfo', full_name='model_interface.BizIDResult.extraInfo', index=1, number=2, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label', full_name='model_interface.BizIDResult.label', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='model_interface.BizIDResult.score', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='modelResult', full_name='model_interface.BizIDResult.modelResult', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=111, serialized_end=279, ) _RESOURCERESPONSE = _descriptor.Descriptor( name='ResourceResponse', full_name='model_interface.ResourceResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='resourceResult', full_name='model_interface.ResourceResponse.resourceResult', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=281, serialized_end=356, ) _RESOURCERESULT = _descriptor.Descriptor( name='ResourceResult', full_name='model_interface.ResourceResult', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='modelStatus', full_name='model_interface.ResourceResult.modelStatus', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='extraInfo', full_name='model_interface.ResourceResult.extraInfo', index=1, number=2, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='modelResult', full_name='model_interface.ResourceResult.modelResult', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=359, serialized_end=500, ) _MODELRESULTINFO = _descriptor.Descriptor( name='ModelResultInfo', full_name='model_interface.ModelResultInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='sourceType', full_name='model_interface.ModelResultInfo.sourceType', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label', full_name='model_interface.ModelResultInfo.label', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='model_interface.ModelResultInfo.score', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='labelResponse', full_name='model_interface.ModelResultInfo.labelResponse', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detectResponse', full_name='model_interface.ModelResultInfo.detectResponse', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=503, serialized_end=682, ) _LABELRESPONSE = _descriptor.Descriptor( name='LabelResponse', full_name='model_interface.LabelResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='status', full_name='model_interface.LabelResponse.status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='labelInfos', full_name='model_interface.LabelResponse.labelInfos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='featureInfos', full_name='model_interface.LabelResponse.featureInfos', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=685, serialized_end=846, ) _LABELINFO = _descriptor.Descriptor( name='LabelInfo', full_name='model_interface.LabelInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='labelID', full_name='model_interface.LabelInfo.labelID', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='labelName', full_name='model_interface.LabelInfo.labelName', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='model_interface.LabelInfo.score', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='info', full_name='model_interface.LabelInfo.info', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='parrentLabelID', full_name='model_interface.LabelInfo.parrentLabelID', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='parrentLabelName', full_name='model_interface.LabelInfo.parrentLabelName', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=848, serialized_end=974, ) _FEATUREINFO = _descriptor.Descriptor( name='FeatureInfo', full_name='model_interface.FeatureInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='featureID', full_name='model_interface.FeatureInfo.featureID', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='featureName', full_name='model_interface.FeatureInfo.featureName', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='model_interface.FeatureInfo.score', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='info', full_name='model_interface.FeatureInfo.info', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='parrentFeatureID', full_name='model_interface.FeatureInfo.parrentFeatureID', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='parrentFeatureName', full_name='model_interface.FeatureInfo.parrentFeatureName', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=977, serialized_end=1113, ) _DETECTRESPONSE = _descriptor.Descriptor( name='DetectResponse', full_name='model_interface.DetectResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='status', full_name='model_interface.DetectResponse.status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detectInfos', full_name='model_interface.DetectResponse.detectInfos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1115, serialized_end=1227, ) _DETECTINFO = _descriptor.Descriptor( name='DetectInfo', full_name='model_interface.DetectInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='instanceIndex', full_name='model_interface.DetectInfo.instanceIndex', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='model_interface.DetectInfo.score', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='coordinates', full_name='model_interface.DetectInfo.coordinates', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='labelInfos', full_name='model_interface.DetectInfo.labelInfos', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='instanceName', full_name='model_interface.DetectInfo.instanceName', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='textOffset', full_name='model_interface.DetectInfo.textOffset', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='areaInfo', full_name='model_interface.DetectInfo.areaInfo', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1230, serialized_end=1494, ) _COORDINATE = _descriptor.Descriptor( name='Coordinate', full_name='model_interface.Coordinate', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='x', full_name='model_interface.Coordinate.x', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='y', full_name='model_interface.Coordinate.y', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1496, serialized_end=1530, ) _TEXTOFFSET = _descriptor.Descriptor( name='TextOffset', full_name='model_interface.TextOffset', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='text', full_name='model_interface.TextOffset.text', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='offset', full_name='model_interface.TextOffset.offset', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='length', full_name='model_interface.TextOffset.length', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1532, serialized_end=1590, ) _AREAINFO = _descriptor.Descriptor( name='AreaInfo', full_name='model_interface.AreaInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='areaRatio', full_name='model_interface.AreaInfo.areaRatio', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='width', full_name='model_interface.AreaInfo.width', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='height', full_name='model_interface.AreaInfo.height', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1592, serialized_end=1652, ) _BIZIDRESPONSE.fields_by_name['bizIdResult'].message_type = _BIZIDRESULT _BIZIDRESULT.fields_by_name['modelStatus'].enum_type = _MODELSTATUS _BIZIDRESULT.fields_by_name['modelResult'].message_type = _MODELRESULTINFO _RESOURCERESPONSE.fields_by_name['resourceResult'].message_type = _RESOURCERESULT _RESOURCERESULT.fields_by_name['modelStatus'].enum_type = _MODELSTATUS _RESOURCERESULT.fields_by_name['modelResult'].message_type = _MODELRESULTINFO _MODELRESULTINFO.fields_by_name['labelResponse'].message_type = _LABELRESPONSE _MODELRESULTINFO.fields_by_name['detectResponse'].message_type = _DETECTRESPONSE _LABELRESPONSE.fields_by_name['status'].enum_type = _MODELSTATUS _LABELRESPONSE.fields_by_name['labelInfos'].message_type = _LABELINFO _LABELRESPONSE.fields_by_name['featureInfos'].message_type = _FEATUREINFO _DETECTRESPONSE.fields_by_name['status'].enum_type = _MODELSTATUS _DETECTRESPONSE.fields_by_name['detectInfos'].message_type = _DETECTINFO _DETECTINFO.fields_by_name['coordinates'].message_type = _COORDINATE _DETECTINFO.fields_by_name['labelInfos'].message_type = _LABELINFO _DETECTINFO.fields_by_name['textOffset'].message_type = _TEXTOFFSET _DETECTINFO.fields_by_name['areaInfo'].message_type = _AREAINFO DESCRIPTOR.message_types_by_name['BizIDResponse'] = _BIZIDRESPONSE DESCRIPTOR.message_types_by_name['BizIDResult'] = _BIZIDRESULT DESCRIPTOR.message_types_by_name['ResourceResponse'] = _RESOURCERESPONSE DESCRIPTOR.message_types_by_name['ResourceResult'] = _RESOURCERESULT DESCRIPTOR.message_types_by_name['ModelResultInfo'] = _MODELRESULTINFO DESCRIPTOR.message_types_by_name['LabelResponse'] = _LABELRESPONSE DESCRIPTOR.message_types_by_name['LabelInfo'] = _LABELINFO DESCRIPTOR.message_types_by_name['FeatureInfo'] = _FEATUREINFO DESCRIPTOR.message_types_by_name['DetectResponse'] = _DETECTRESPONSE DESCRIPTOR.message_types_by_name['DetectInfo'] = _DETECTINFO DESCRIPTOR.message_types_by_name['Coordinate'] = _COORDINATE DESCRIPTOR.message_types_by_name['TextOffset'] = _TEXTOFFSET DESCRIPTOR.message_types_by_name['AreaInfo'] = _AREAINFO DESCRIPTOR.enum_types_by_name['ModelStatus'] = _MODELSTATUS _sym_db.RegisterFileDescriptor(DESCRIPTOR) BizIDResponse = _reflection.GeneratedProtocolMessageType('BizIDResponse', (_message.Message,), { 'DESCRIPTOR' : _BIZIDRESPONSE, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.BizIDResponse) }) _sym_db.RegisterMessage(BizIDResponse) BizIDResult = _reflection.GeneratedProtocolMessageType('BizIDResult', (_message.Message,), { 'DESCRIPTOR' : _BIZIDRESULT, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.BizIDResult) }) _sym_db.RegisterMessage(BizIDResult) ResourceResponse = _reflection.GeneratedProtocolMessageType('ResourceResponse', (_message.Message,), { 'DESCRIPTOR' : _RESOURCERESPONSE, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.ResourceResponse) }) _sym_db.RegisterMessage(ResourceResponse) ResourceResult = _reflection.GeneratedProtocolMessageType('ResourceResult', (_message.Message,), { 'DESCRIPTOR' : _RESOURCERESULT, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.ResourceResult) }) _sym_db.RegisterMessage(ResourceResult) ModelResultInfo = _reflection.GeneratedProtocolMessageType('ModelResultInfo', (_message.Message,), { 'DESCRIPTOR' : _MODELRESULTINFO, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.ModelResultInfo) }) _sym_db.RegisterMessage(ModelResultInfo) LabelResponse = _reflection.GeneratedProtocolMessageType('LabelResponse', (_message.Message,), { 'DESCRIPTOR' : _LABELRESPONSE, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.LabelResponse) }) _sym_db.RegisterMessage(LabelResponse) LabelInfo = _reflection.GeneratedProtocolMessageType('LabelInfo', (_message.Message,), { 'DESCRIPTOR' : _LABELINFO, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.LabelInfo) }) _sym_db.RegisterMessage(LabelInfo) FeatureInfo = _reflection.GeneratedProtocolMessageType('FeatureInfo', (_message.Message,), { 'DESCRIPTOR' : _FEATUREINFO, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.FeatureInfo) }) _sym_db.RegisterMessage(FeatureInfo) DetectResponse = _reflection.GeneratedProtocolMessageType('DetectResponse', (_message.Message,), { 'DESCRIPTOR' : _DETECTRESPONSE, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.DetectResponse) }) _sym_db.RegisterMessage(DetectResponse) DetectInfo = _reflection.GeneratedProtocolMessageType('DetectInfo', (_message.Message,), { 'DESCRIPTOR' : _DETECTINFO, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.DetectInfo) }) _sym_db.RegisterMessage(DetectInfo) Coordinate = _reflection.GeneratedProtocolMessageType('Coordinate', (_message.Message,), { 'DESCRIPTOR' : _COORDINATE, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.Coordinate) }) _sym_db.RegisterMessage(Coordinate) TextOffset = _reflection.GeneratedProtocolMessageType('TextOffset', (_message.Message,), { 'DESCRIPTOR' : _TEXTOFFSET, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.TextOffset) }) _sym_db.RegisterMessage(TextOffset) AreaInfo = _reflection.GeneratedProtocolMessageType('AreaInfo', (_message.Message,), { 'DESCRIPTOR' : _AREAINFO, '__module__' : 'model_interface_pb2' # @@protoc_insertion_point(class_scope:model_interface.AreaInfo) }) _sym_db.RegisterMessage(AreaInfo) # @@protoc_insertion_point(module_scope) ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/ocr_task_pb2.py ===== # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: ocr_task.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='ocr_task.proto', package='ocr', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x0eocr_task.proto\x12\x03ocr\"f\n\nCVResponse\x12*\n\x0elabel_response\x18\x01 \x01(\x0b\x32\x12.ocr.LabelResponse\x12,\n\x0f\x64\x65tect_response\x18\x02 \x01(\x0b\x32\x13.ocr.DetectResponse\"Z\n\rLabelResponse\x12$\n\rresult_status\x18\x01 \x01(\x0e\x32\r.ocr.CVStatus\x12#\n\x0blabel_infos\x18\x02 \x03(\x0b\x32\x0e.ocr.LabelInfo\"]\n\x0e\x44\x65tectResponse\x12$\n\rresult_status\x18\x01 \x01(\x0e\x32\r.ocr.CVStatus\x12%\n\x0c\x64\x65tect_infos\x18\x02 \x03(\x0b\x32\x0f.ocr.DetectInfo\"\"\n\nCoordinate\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"7\n\tLabelInfo\x12\r\n\x05label\x18\x01 \x01(\x05\x12\r\n\x05score\x18\x02 \x01(\x05\x12\x0c\n\x04info\x18\x03 \x01(\t\"~\n\nDetectInfo\x12\x16\n\x0einstance_index\x18\x01 \x01(\x05\x12\r\n\x05score\x18\x02 \x01(\x02\x12$\n\x0b\x63oordinates\x18\x03 \x03(\x0b\x32\x0f.ocr.Coordinate\x12#\n\x0blabel_infos\x18\x04 \x03(\x0b\x32\x0e.ocr.LabelInfo*\xd5\x01\n\x08\x43VStatus\x12\x12\n\x0eSUCCEED_NORMAL\x10\x00\x12\x0f\n\x0bSUCCEED_HIT\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x08\n\x04\x46\x41IL\x10\x03\x12\x10\n\x0c\x45RROR_UKNOWN\x10\x64\x12\x16\n\x12\x45RROR_URL_DOWNLOAD\x10\x65\x12\x14\n\x10\x45RROR_DB_RED_KEY\x10\x66\x12\x11\n\x0c\x45RROR_CV_ERR\x10\xd9\x04\x12\x1b\n\x16\x45RROR_IMAGE_PREPROCESS\x10\xda\x04\x12\x1a\n\x15\x45RROR_MODEL_INFERENCE\x10\xdb\x04\x62\x06proto3' ) _CVSTATUS = _descriptor.EnumDescriptor( name='CVStatus', full_name='ocr.CVStatus', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SUCCEED_NORMAL', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SUCCEED_HIT', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROCESSING', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FAIL', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_UKNOWN', index=4, number=100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_URL_DOWNLOAD', index=5, number=101, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_DB_RED_KEY', index=6, number=102, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_CV_ERR', index=7, number=601, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_IMAGE_PREPROCESS', index=8, number=602, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_MODEL_INFERENCE', index=9, number=603, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=536, serialized_end=749, ) _sym_db.RegisterEnumDescriptor(_CVSTATUS) CVStatus = enum_type_wrapper.EnumTypeWrapper(_CVSTATUS) SUCCEED_NORMAL = 0 SUCCEED_HIT = 1 PROCESSING = 2 FAIL = 3 ERROR_UKNOWN = 100 ERROR_URL_DOWNLOAD = 101 ERROR_DB_RED_KEY = 102 ERROR_CV_ERR = 601 ERROR_IMAGE_PREPROCESS = 602 ERROR_MODEL_INFERENCE = 603 _CVRESPONSE = _descriptor.Descriptor( name='CVResponse', full_name='ocr.CVResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='label_response', full_name='ocr.CVResponse.label_response', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detect_response', full_name='ocr.CVResponse.detect_response', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=23, serialized_end=125, ) _LABELRESPONSE = _descriptor.Descriptor( name='LabelResponse', full_name='ocr.LabelResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='result_status', full_name='ocr.LabelResponse.result_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label_infos', full_name='ocr.LabelResponse.label_infos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=127, serialized_end=217, ) _DETECTRESPONSE = _descriptor.Descriptor( name='DetectResponse', full_name='ocr.DetectResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='result_status', full_name='ocr.DetectResponse.result_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detect_infos', full_name='ocr.DetectResponse.detect_infos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=219, serialized_end=312, ) _COORDINATE = _descriptor.Descriptor( name='Coordinate', full_name='ocr.Coordinate', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='x', full_name='ocr.Coordinate.x', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='y', full_name='ocr.Coordinate.y', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=314, serialized_end=348, ) _LABELINFO = _descriptor.Descriptor( name='LabelInfo', full_name='ocr.LabelInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='label', full_name='ocr.LabelInfo.label', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='ocr.LabelInfo.score', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='info', full_name='ocr.LabelInfo.info', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=350, serialized_end=405, ) _DETECTINFO = _descriptor.Descriptor( name='DetectInfo', full_name='ocr.DetectInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='instance_index', full_name='ocr.DetectInfo.instance_index', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='ocr.DetectInfo.score', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='coordinates', full_name='ocr.DetectInfo.coordinates', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label_infos', full_name='ocr.DetectInfo.label_infos', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=407, serialized_end=533, ) _CVRESPONSE.fields_by_name['label_response'].message_type = _LABELRESPONSE _CVRESPONSE.fields_by_name['detect_response'].message_type = _DETECTRESPONSE _LABELRESPONSE.fields_by_name['result_status'].enum_type = _CVSTATUS _LABELRESPONSE.fields_by_name['label_infos'].message_type = _LABELINFO _DETECTRESPONSE.fields_by_name['result_status'].enum_type = _CVSTATUS _DETECTRESPONSE.fields_by_name['detect_infos'].message_type = _DETECTINFO _DETECTINFO.fields_by_name['coordinates'].message_type = _COORDINATE _DETECTINFO.fields_by_name['label_infos'].message_type = _LABELINFO DESCRIPTOR.message_types_by_name['CVResponse'] = _CVRESPONSE DESCRIPTOR.message_types_by_name['LabelResponse'] = _LABELRESPONSE DESCRIPTOR.message_types_by_name['DetectResponse'] = _DETECTRESPONSE DESCRIPTOR.message_types_by_name['Coordinate'] = _COORDINATE DESCRIPTOR.message_types_by_name['LabelInfo'] = _LABELINFO DESCRIPTOR.message_types_by_name['DetectInfo'] = _DETECTINFO DESCRIPTOR.enum_types_by_name['CVStatus'] = _CVSTATUS _sym_db.RegisterFileDescriptor(DESCRIPTOR) CVResponse = _reflection.GeneratedProtocolMessageType('CVResponse', (_message.Message,), { 'DESCRIPTOR' : _CVRESPONSE, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.CVResponse) }) _sym_db.RegisterMessage(CVResponse) LabelResponse = _reflection.GeneratedProtocolMessageType('LabelResponse', (_message.Message,), { 'DESCRIPTOR' : _LABELRESPONSE, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.LabelResponse) }) _sym_db.RegisterMessage(LabelResponse) DetectResponse = _reflection.GeneratedProtocolMessageType('DetectResponse', (_message.Message,), { 'DESCRIPTOR' : _DETECTRESPONSE, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.DetectResponse) }) _sym_db.RegisterMessage(DetectResponse) Coordinate = _reflection.GeneratedProtocolMessageType('Coordinate', (_message.Message,), { 'DESCRIPTOR' : _COORDINATE, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.Coordinate) }) _sym_db.RegisterMessage(Coordinate) LabelInfo = _reflection.GeneratedProtocolMessageType('LabelInfo', (_message.Message,), { 'DESCRIPTOR' : _LABELINFO, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.LabelInfo) }) _sym_db.RegisterMessage(LabelInfo) DetectInfo = _reflection.GeneratedProtocolMessageType('DetectInfo', (_message.Message,), { 'DESCRIPTOR' : _DETECTINFO, '__module__' : 'ocr_task_pb2' # @@protoc_insertion_point(class_scope:ocr.DetectInfo) }) _sym_db.RegisterMessage(DetectInfo) # @@protoc_insertion_point(module_scope) ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/rpc/base/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/rpc/base/BaseService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): """ the BaseService is defined for management purpose, such as check alive. """ def ping(self): """ for checking alive """ pass class Client(Iface): """ the BaseService is defined for management purpose, such as check alive. """ def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def ping(self): """ for checking alive """ self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["ping"] = Processor.process_ping def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/rpc/base/__init__.py ===== __all__ = ['ttypes', 'constants', 'BaseService'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/rpc/base/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport all_structs = [] class ProjectType(object): """ multi-app 枚举类型 """ XHS = 0 TOP = 1 _VALUES_TO_NAMES = { 0: "XHS", 1: "TOP", } _NAMES_TO_VALUES = { "XHS": 0, "TOP": 1, } class Context(object): """ rpc context that contains: 1: open tracing infomation 2: userID for log coloring 3: an expandable map for custom loads Attributes: - traceID: open tracing trace id - clientHost: the caller's host (IP or hostname) - baggage: open tracing baggae, can be used to carry custom loads - spanID: open tracing span id - sampled: whether the very request is sampled - parentSpanID: open tracing parent span ID - userID: userID for log coloring - appID: appID for multi-app - projectID: projectID for multi-app - appBuild: app build number - appPlatform: app platform - userIP: user ip address """ def __init__(self, traceID=None, clientHost=None, baggage=None, spanID=None, sampled=None, parentSpanID=None, userID=None, appID=None, projectID=None, appBuild=None, appPlatform=None, userIP=None,): self.traceID = traceID self.clientHost = clientHost self.baggage = baggage self.spanID = spanID self.sampled = sampled self.parentSpanID = parentSpanID self.userID = userID self.appID = appID self.projectID = projectID self.appBuild = appBuild self.appPlatform = appPlatform self.userIP = userIP def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.traceID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.clientHost = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.baggage = {} (_ktype1, _vtype2, _size0) = iprot.readMapBegin() for _i4 in range(_size0): _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val6 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.baggage[_key5] = _val6 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.spanID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.sampled = iprot.readBool() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.parentSpanID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.userID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.appID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.projectID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: self.appBuild = iprot.readI32() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.appPlatform = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: self.userIP = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Context') if self.traceID is not None: oprot.writeFieldBegin('traceID', TType.STRING, 1) oprot.writeString(self.traceID.encode('utf-8') if sys.version_info[0] == 2 else self.traceID) oprot.writeFieldEnd() if self.clientHost is not None: oprot.writeFieldBegin('clientHost', TType.STRING, 2) oprot.writeString(self.clientHost.encode('utf-8') if sys.version_info[0] == 2 else self.clientHost) oprot.writeFieldEnd() if self.baggage is not None: oprot.writeFieldBegin('baggage', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.baggage)) for kiter7, viter8 in self.baggage.items(): oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7) oprot.writeString(viter8.encode('utf-8') if sys.version_info[0] == 2 else viter8) oprot.writeMapEnd() oprot.writeFieldEnd() if self.spanID is not None: oprot.writeFieldBegin('spanID', TType.STRING, 4) oprot.writeString(self.spanID.encode('utf-8') if sys.version_info[0] == 2 else self.spanID) oprot.writeFieldEnd() if self.sampled is not None: oprot.writeFieldBegin('sampled', TType.BOOL, 5) oprot.writeBool(self.sampled) oprot.writeFieldEnd() if self.parentSpanID is not None: oprot.writeFieldBegin('parentSpanID', TType.STRING, 6) oprot.writeString(self.parentSpanID.encode('utf-8') if sys.version_info[0] == 2 else self.parentSpanID) oprot.writeFieldEnd() if self.userID is not None: oprot.writeFieldBegin('userID', TType.STRING, 7) oprot.writeString(self.userID.encode('utf-8') if sys.version_info[0] == 2 else self.userID) oprot.writeFieldEnd() if self.appID is not None: oprot.writeFieldBegin('appID', TType.STRING, 8) oprot.writeString(self.appID.encode('utf-8') if sys.version_info[0] == 2 else self.appID) oprot.writeFieldEnd() if self.projectID is not None: oprot.writeFieldBegin('projectID', TType.STRING, 9) oprot.writeString(self.projectID.encode('utf-8') if sys.version_info[0] == 2 else self.projectID) oprot.writeFieldEnd() if self.appBuild is not None: oprot.writeFieldBegin('appBuild', TType.I32, 10) oprot.writeI32(self.appBuild) oprot.writeFieldEnd() if self.appPlatform is not None: oprot.writeFieldBegin('appPlatform', TType.STRING, 11) oprot.writeString(self.appPlatform.encode('utf-8') if sys.version_info[0] == 2 else self.appPlatform) oprot.writeFieldEnd() if self.userIP is not None: oprot.writeFieldBegin('userIP', TType.STRING, 12) oprot.writeString(self.userIP.encode('utf-8') if sys.version_info[0] == 2 else self.userIP) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class Result(object): """ common result Attributes: - success - code - message """ def __init__(self, success=None, code=None, message=None,): self.success = success self.code = code self.message = message def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.code = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 1) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.code is not None: oprot.writeFieldBegin('code', TType.I32, 2) oprot.writeI32(self.code) oprot.writeFieldEnd() if self.message is not None: oprot.writeFieldBegin('message', TType.STRING, 3) oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.success is None: raise TProtocolException(message='Required field success is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Context) Context.thrift_spec = ( None, # 0 (1, TType.STRING, 'traceID', 'UTF8', None, ), # 1 (2, TType.STRING, 'clientHost', 'UTF8', None, ), # 2 (3, TType.MAP, 'baggage', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRING, 'spanID', 'UTF8', None, ), # 4 (5, TType.BOOL, 'sampled', None, None, ), # 5 (6, TType.STRING, 'parentSpanID', 'UTF8', None, ), # 6 (7, TType.STRING, 'userID', 'UTF8', None, ), # 7 (8, TType.STRING, 'appID', 'UTF8', None, ), # 8 (9, TType.STRING, 'projectID', 'UTF8', None, ), # 9 (10, TType.I32, 'appBuild', None, None, ), # 10 (11, TType.STRING, 'appPlatform', 'UTF8', None, ), # 11 (12, TType.STRING, 'userIP', 'UTF8', None, ), # 12 ) all_structs.append(Result) Result.thrift_spec = ( None, # 0 (1, TType.BOOL, 'success', None, None, ), # 1 (2, TType.I32, 'code', None, None, ), # 2 (3, TType.STRING, 'message', 'UTF8', None, ), # 3 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/rpc/__init__.py ===== ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/infra/__init__.py ===== ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/cv_task_pb2.py ===== # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cv_task.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='cv_task.proto', package='mlsys', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\rcv_task.proto\x12\x05mlsys\"j\n\nCVResponse\x12,\n\x0elabel_response\x18\x01 \x01(\x0b\x32\x14.mlsys.LabelResponse\x12.\n\x0f\x64\x65tect_response\x18\x02 \x01(\x0b\x32\x15.mlsys.DetectResponse\"^\n\rLabelResponse\x12&\n\rresult_status\x18\x01 \x01(\x0e\x32\x0f.mlsys.CVStatus\x12%\n\x0blabel_infos\x18\x02 \x03(\x0b\x32\x10.mlsys.LabelInfo\"a\n\x0e\x44\x65tectResponse\x12&\n\rresult_status\x18\x01 \x01(\x0e\x32\x0f.mlsys.CVStatus\x12\'\n\x0c\x64\x65tect_infos\x18\x02 \x03(\x0b\x32\x11.mlsys.DetectInfo\"\"\n\nCoordinate\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\"7\n\tLabelInfo\x12\r\n\x05label\x18\x01 \x01(\x05\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x0c\n\x04info\x18\x03 \x01(\t\"\x82\x01\n\nDetectInfo\x12\x16\n\x0einstance_index\x18\x01 \x01(\x05\x12\r\n\x05score\x18\x02 \x01(\x01\x12&\n\x0b\x63oordinates\x18\x03 \x03(\x0b\x32\x11.mlsys.Coordinate\x12%\n\x0blabel_infos\x18\x04 \x03(\x0b\x32\x10.mlsys.LabelInfo*\xd5\x01\n\x08\x43VStatus\x12\x12\n\x0eSUCCEED_NORMAL\x10\x00\x12\x0f\n\x0bSUCCEED_HIT\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x08\n\x04\x46\x41IL\x10\x03\x12\x10\n\x0c\x45RROR_UKNOWN\x10\x64\x12\x16\n\x12\x45RROR_URL_DOWNLOAD\x10\x65\x12\x14\n\x10\x45RROR_DB_RED_KEY\x10\x66\x12\x11\n\x0c\x45RROR_CV_ERR\x10\xd9\x04\x12\x1b\n\x16\x45RROR_IMAGE_PREPROCESS\x10\xda\x04\x12\x1a\n\x15\x45RROR_MODEL_INFERENCE\x10\xdb\x04\x62\x06proto3' ) _CVSTATUS = _descriptor.EnumDescriptor( name='CVStatus', full_name='mlsys.CVStatus', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SUCCEED_NORMAL', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SUCCEED_HIT', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROCESSING', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FAIL', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_UKNOWN', index=4, number=100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_URL_DOWNLOAD', index=5, number=101, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_DB_RED_KEY', index=6, number=102, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_CV_ERR', index=7, number=601, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_IMAGE_PREPROCESS', index=8, number=602, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR_MODEL_INFERENCE', index=9, number=603, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=554, serialized_end=767, ) _sym_db.RegisterEnumDescriptor(_CVSTATUS) CVStatus = enum_type_wrapper.EnumTypeWrapper(_CVSTATUS) SUCCEED_NORMAL = 0 SUCCEED_HIT = 1 PROCESSING = 2 FAIL = 3 ERROR_UKNOWN = 100 ERROR_URL_DOWNLOAD = 101 ERROR_DB_RED_KEY = 102 ERROR_CV_ERR = 601 ERROR_IMAGE_PREPROCESS = 602 ERROR_MODEL_INFERENCE = 603 _CVRESPONSE = _descriptor.Descriptor( name='CVResponse', full_name='mlsys.CVResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='label_response', full_name='mlsys.CVResponse.label_response', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detect_response', full_name='mlsys.CVResponse.detect_response', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=24, serialized_end=130, ) _LABELRESPONSE = _descriptor.Descriptor( name='LabelResponse', full_name='mlsys.LabelResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='result_status', full_name='mlsys.LabelResponse.result_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label_infos', full_name='mlsys.LabelResponse.label_infos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=132, serialized_end=226, ) _DETECTRESPONSE = _descriptor.Descriptor( name='DetectResponse', full_name='mlsys.DetectResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='result_status', full_name='mlsys.DetectResponse.result_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='detect_infos', full_name='mlsys.DetectResponse.detect_infos', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=228, serialized_end=325, ) _COORDINATE = _descriptor.Descriptor( name='Coordinate', full_name='mlsys.Coordinate', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='x', full_name='mlsys.Coordinate.x', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='y', full_name='mlsys.Coordinate.y', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=327, serialized_end=361, ) _LABELINFO = _descriptor.Descriptor( name='LabelInfo', full_name='mlsys.LabelInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='label', full_name='mlsys.LabelInfo.label', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='mlsys.LabelInfo.score', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='info', full_name='mlsys.LabelInfo.info', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=363, serialized_end=418, ) _DETECTINFO = _descriptor.Descriptor( name='DetectInfo', full_name='mlsys.DetectInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='instance_index', full_name='mlsys.DetectInfo.instance_index', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='score', full_name='mlsys.DetectInfo.score', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='coordinates', full_name='mlsys.DetectInfo.coordinates', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='label_infos', full_name='mlsys.DetectInfo.label_infos', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=421, serialized_end=551, ) _CVRESPONSE.fields_by_name['label_response'].message_type = _LABELRESPONSE _CVRESPONSE.fields_by_name['detect_response'].message_type = _DETECTRESPONSE _LABELRESPONSE.fields_by_name['result_status'].enum_type = _CVSTATUS _LABELRESPONSE.fields_by_name['label_infos'].message_type = _LABELINFO _DETECTRESPONSE.fields_by_name['result_status'].enum_type = _CVSTATUS _DETECTRESPONSE.fields_by_name['detect_infos'].message_type = _DETECTINFO _DETECTINFO.fields_by_name['coordinates'].message_type = _COORDINATE _DETECTINFO.fields_by_name['label_infos'].message_type = _LABELINFO DESCRIPTOR.message_types_by_name['CVResponse'] = _CVRESPONSE DESCRIPTOR.message_types_by_name['LabelResponse'] = _LABELRESPONSE DESCRIPTOR.message_types_by_name['DetectResponse'] = _DETECTRESPONSE DESCRIPTOR.message_types_by_name['Coordinate'] = _COORDINATE DESCRIPTOR.message_types_by_name['LabelInfo'] = _LABELINFO DESCRIPTOR.message_types_by_name['DetectInfo'] = _DETECTINFO DESCRIPTOR.enum_types_by_name['CVStatus'] = _CVSTATUS _sym_db.RegisterFileDescriptor(DESCRIPTOR) CVResponse = _reflection.GeneratedProtocolMessageType('CVResponse', (_message.Message,), { 'DESCRIPTOR' : _CVRESPONSE, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.CVResponse) }) _sym_db.RegisterMessage(CVResponse) LabelResponse = _reflection.GeneratedProtocolMessageType('LabelResponse', (_message.Message,), { 'DESCRIPTOR' : _LABELRESPONSE, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.LabelResponse) }) _sym_db.RegisterMessage(LabelResponse) DetectResponse = _reflection.GeneratedProtocolMessageType('DetectResponse', (_message.Message,), { 'DESCRIPTOR' : _DETECTRESPONSE, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.DetectResponse) }) _sym_db.RegisterMessage(DetectResponse) Coordinate = _reflection.GeneratedProtocolMessageType('Coordinate', (_message.Message,), { 'DESCRIPTOR' : _COORDINATE, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.Coordinate) }) _sym_db.RegisterMessage(Coordinate) LabelInfo = _reflection.GeneratedProtocolMessageType('LabelInfo', (_message.Message,), { 'DESCRIPTOR' : _LABELINFO, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.LabelInfo) }) _sym_db.RegisterMessage(LabelInfo) DetectInfo = _reflection.GeneratedProtocolMessageType('DetectInfo', (_message.Message,), { 'DESCRIPTOR' : _DETECTINFO, '__module__' : 'cv_task_pb2' # @@protoc_insertion_point(class_scope:mlsys.DetectInfo) }) _sym_db.RegisterMessage(DetectInfo) # @@protoc_insertion_point(module_scope) ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/innermodelinterface/InnerAIModelService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): def ping(self): pass def bizIDQuery(self, bizIDRequest): """ Parameters: - bizIDRequest """ pass def resourceQuery(self, resourceRequest): """ Parameters: - resourceRequest """ pass def ServerHealth(self, request): """ Parameters: - request """ pass def ModelStatus(self, request): """ Parameters: - request """ pass def Infer(self, request): """ Parameters: - request """ pass class Client(Iface): def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def ping(self): self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return def bizIDQuery(self, bizIDRequest): """ Parameters: - bizIDRequest """ self.send_bizIDQuery(bizIDRequest) return self.recv_bizIDQuery() def send_bizIDQuery(self, bizIDRequest): self._oprot.writeMessageBegin('bizIDQuery', TMessageType.CALL, self._seqid) args = bizIDQuery_args() args.bizIDRequest = bizIDRequest args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_bizIDQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = bizIDQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "bizIDQuery failed: unknown result") def resourceQuery(self, resourceRequest): """ Parameters: - resourceRequest """ self.send_resourceQuery(resourceRequest) return self.recv_resourceQuery() def send_resourceQuery(self, resourceRequest): self._oprot.writeMessageBegin('resourceQuery', TMessageType.CALL, self._seqid) args = resourceQuery_args() args.resourceRequest = resourceRequest args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_resourceQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = resourceQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "resourceQuery failed: unknown result") def ServerHealth(self, request): """ Parameters: - request """ self.send_ServerHealth(request) return self.recv_ServerHealth() def send_ServerHealth(self, request): self._oprot.writeMessageBegin('ServerHealth', TMessageType.CALL, self._seqid) args = ServerHealth_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ServerHealth(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ServerHealth_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ServerHealth failed: unknown result") def ModelStatus(self, request): """ Parameters: - request """ self.send_ModelStatus(request) return self.recv_ModelStatus() def send_ModelStatus(self, request): self._oprot.writeMessageBegin('ModelStatus', TMessageType.CALL, self._seqid) args = ModelStatus_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ModelStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ModelStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ModelStatus failed: unknown result") def Infer(self, request): """ Parameters: - request """ self.send_Infer(request) return self.recv_Infer() def send_Infer(self, request): self._oprot.writeMessageBegin('Infer', TMessageType.CALL, self._seqid) args = Infer_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_Infer(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = Infer_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "Infer failed: unknown result") class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["ping"] = Processor.process_ping self._processMap["bizIDQuery"] = Processor.process_bizIDQuery self._processMap["resourceQuery"] = Processor.process_resourceQuery self._processMap["ServerHealth"] = Processor.process_ServerHealth self._processMap["ModelStatus"] = Processor.process_ModelStatus self._processMap["Infer"] = Processor.process_Infer def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_bizIDQuery(self, seqid, iprot, oprot): args = bizIDQuery_args() args.read(iprot) iprot.readMessageEnd() result = bizIDQuery_result() try: result.success = self._handler.bizIDQuery(args.bizIDRequest) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("bizIDQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_resourceQuery(self, seqid, iprot, oprot): args = resourceQuery_args() args.read(iprot) iprot.readMessageEnd() result = resourceQuery_result() try: result.success = self._handler.resourceQuery(args.resourceRequest) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("resourceQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_ServerHealth(self, seqid, iprot, oprot): args = ServerHealth_args() args.read(iprot) iprot.readMessageEnd() result = ServerHealth_result() try: result.success = self._handler.ServerHealth(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ServerHealth", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_ModelStatus(self, seqid, iprot, oprot): args = ModelStatus_args() args.read(iprot) iprot.readMessageEnd() result = ModelStatus_result() try: result.success = self._handler.ModelStatus(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ModelStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_Infer(self, seqid, iprot, oprot): args = Infer_args() args.read(iprot) iprot.readMessageEnd() result = Infer_result() try: result.success = self._handler.Infer(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("Infer", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) class bizIDQuery_args(object): """ Attributes: - bizIDRequest """ def __init__(self, bizIDRequest=None,): self.bizIDRequest = bizIDRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.bizIDRequest = InnerBizIDRequest() self.bizIDRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('bizIDQuery_args') if self.bizIDRequest is not None: oprot.writeFieldBegin('bizIDRequest', TType.STRUCT, 1) self.bizIDRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(bizIDQuery_args) bizIDQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'bizIDRequest', [InnerBizIDRequest, None], None, ), # 1 ) class bizIDQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = aimedia.modelinterface.ttypes.BizIDResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('bizIDQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(bizIDQuery_result) bizIDQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [aimedia.modelinterface.ttypes.BizIDResponse, None], None, ), # 0 ) class resourceQuery_args(object): """ Attributes: - resourceRequest """ def __init__(self, resourceRequest=None,): self.resourceRequest = resourceRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.resourceRequest = InnerResourceRequest() self.resourceRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('resourceQuery_args') if self.resourceRequest is not None: oprot.writeFieldBegin('resourceRequest', TType.STRUCT, 1) self.resourceRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(resourceQuery_args) resourceQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'resourceRequest', [InnerResourceRequest, None], None, ), # 1 ) class resourceQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = aimedia.modelinterface.ttypes.ResourceResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('resourceQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(resourceQuery_result) resourceQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [aimedia.modelinterface.ttypes.ResourceResponse, None], None, ), # 0 ) class ServerHealth_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = aimedia.inferservice.ttypes.HealthRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ServerHealth_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ServerHealth_args) ServerHealth_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [aimedia.inferservice.ttypes.HealthRequest, None], None, ), # 1 ) class ServerHealth_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = aimedia.inferservice.ttypes.HealthResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ServerHealth_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ServerHealth_result) ServerHealth_result.thrift_spec = ( (0, TType.STRUCT, 'success', [aimedia.inferservice.ttypes.HealthResponse, None], None, ), # 0 ) class ModelStatus_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = aimedia.inferservice.ttypes.StatusRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ModelStatus_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ModelStatus_args) ModelStatus_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [aimedia.inferservice.ttypes.StatusRequest, None], None, ), # 1 ) class ModelStatus_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = aimedia.inferservice.ttypes.StatusResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ModelStatus_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ModelStatus_result) ModelStatus_result.thrift_spec = ( (0, TType.STRUCT, 'success', [aimedia.inferservice.ttypes.StatusResponse, None], None, ), # 0 ) class Infer_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = aimedia.inferservice.ttypes.InferRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Infer_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Infer_args) Infer_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [aimedia.inferservice.ttypes.InferRequest, None], None, ), # 1 ) class Infer_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = aimedia.inferservice.ttypes.InferResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Infer_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Infer_result) Infer_result.thrift_spec = ( (0, TType.STRUCT, 'success', [aimedia.inferservice.ttypes.InferResponse, None], None, ), # 0 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/innermodelinterface/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/innermodelinterface/__init__.py ===== __all__ = ['ttypes', 'constants', 'InnerAIModelService'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/innermodelinterface/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import infra.rpc.base.ttypes import aimedia.modelinterface.ttypes import aimedia.inferservice.ttypes from thrift.transport import TTransport all_structs = [] class InnerBizIDRequest(object): """ Attributes: - context - bizIDRequest """ def __init__(self, context=None, bizIDRequest=None,): self.context = context self.bizIDRequest = bizIDRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.context = infra.rpc.base.ttypes.Context() self.context.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.bizIDRequest = aimedia.modelinterface.ttypes.BizIDRequest() self.bizIDRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InnerBizIDRequest') if self.context is not None: oprot.writeFieldBegin('context', TType.STRUCT, 1) self.context.write(oprot) oprot.writeFieldEnd() if self.bizIDRequest is not None: oprot.writeFieldBegin('bizIDRequest', TType.STRUCT, 2) self.bizIDRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InnerResourceRequest(object): """ Attributes: - context - resourceRequest """ def __init__(self, context=None, resourceRequest=None,): self.context = context self.resourceRequest = resourceRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.context = infra.rpc.base.ttypes.Context() self.context.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.resourceRequest = aimedia.modelinterface.ttypes.ResourceRequest() self.resourceRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InnerResourceRequest') if self.context is not None: oprot.writeFieldBegin('context', TType.STRUCT, 1) self.context.write(oprot) oprot.writeFieldEnd() if self.resourceRequest is not None: oprot.writeFieldBegin('resourceRequest', TType.STRUCT, 2) self.resourceRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(InnerBizIDRequest) InnerBizIDRequest.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'context', [infra.rpc.base.ttypes.Context, None], None, ), # 1 (2, TType.STRUCT, 'bizIDRequest', [aimedia.modelinterface.ttypes.BizIDRequest, None], None, ), # 2 ) all_structs.append(InnerResourceRequest) InnerResourceRequest.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'context', [infra.rpc.base.ttypes.Context, None], None, ), # 1 (2, TType.STRUCT, 'resourceRequest', [aimedia.modelinterface.ttypes.ResourceRequest, None], None, ), # 2 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/InferService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): def ping(self): pass def Status(self, request): """ Parameters: - request """ pass def Health(self, request): """ Parameters: - request """ pass def Infer(self, request): """ Parameters: - request """ pass class Client(Iface): def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def ping(self): self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return def Status(self, request): """ Parameters: - request """ self.send_Status(request) return self.recv_Status() def send_Status(self, request): self._oprot.writeMessageBegin('Status', TMessageType.CALL, self._seqid) args = Status_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_Status(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = Status_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "Status failed: unknown result") def Health(self, request): """ Parameters: - request """ self.send_Health(request) return self.recv_Health() def send_Health(self, request): self._oprot.writeMessageBegin('Health', TMessageType.CALL, self._seqid) args = Health_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_Health(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = Health_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "Health failed: unknown result") def Infer(self, request): """ Parameters: - request """ self.send_Infer(request) return self.recv_Infer() def send_Infer(self, request): self._oprot.writeMessageBegin('Infer', TMessageType.CALL, self._seqid) args = Infer_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_Infer(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = Infer_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "Infer failed: unknown result") class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["ping"] = Processor.process_ping self._processMap["Status"] = Processor.process_Status self._processMap["Health"] = Processor.process_Health self._processMap["Infer"] = Processor.process_Infer def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_Status(self, seqid, iprot, oprot): args = Status_args() args.read(iprot) iprot.readMessageEnd() result = Status_result() try: result.success = self._handler.Status(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("Status", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_Health(self, seqid, iprot, oprot): args = Health_args() args.read(iprot) iprot.readMessageEnd() result = Health_result() try: result.success = self._handler.Health(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("Health", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_Infer(self, seqid, iprot, oprot): args = Infer_args() args.read(iprot) iprot.readMessageEnd() result = Infer_result() try: result.success = self._handler.Infer(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("Infer", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) class Status_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = StatusRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Status_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Status_args) Status_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [StatusRequest, None], None, ), # 1 ) class Status_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = StatusResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Status_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Status_result) Status_result.thrift_spec = ( (0, TType.STRUCT, 'success', [StatusResponse, None], None, ), # 0 ) class Health_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = HealthRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Health_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Health_args) Health_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [HealthRequest, None], None, ), # 1 ) class Health_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = HealthResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Health_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Health_result) Health_result.thrift_spec = ( (0, TType.STRUCT, 'success', [HealthResponse, None], None, ), # 0 ) class Infer_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request = InferRequest() self.request.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Infer_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Infer_args) Infer_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [InferRequest, None], None, ), # 1 ) class Infer_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = InferResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Infer_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Infer_result) Infer_result.thrift_spec = ( (0, TType.STRUCT, 'success', [InferResponse, None], None, ), # 0 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/datatype/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/datatype/__init__.py ===== __all__ = ['ttypes', 'constants'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/datatype/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport all_structs = [] class DataType(object): TYPE_INVALID = 0 TYPE_BOOL = 1 TYPE_UINT8 = 2 TYPE_UINT16 = 3 TYPE_UINT32 = 4 TYPE_UINT64 = 5 TYPE_INT8 = 6 TYPE_INT16 = 7 TYPE_INT32 = 8 TYPE_INT64 = 9 TYPE_FP16 = 10 TYPE_FP32 = 11 TYPE_FP64 = 12 TYPE_STRING = 13 _VALUES_TO_NAMES = { 0: "TYPE_INVALID", 1: "TYPE_BOOL", 2: "TYPE_UINT8", 3: "TYPE_UINT16", 4: "TYPE_UINT32", 5: "TYPE_UINT64", 6: "TYPE_INT8", 7: "TYPE_INT16", 8: "TYPE_INT32", 9: "TYPE_INT64", 10: "TYPE_FP16", 11: "TYPE_FP32", 12: "TYPE_FP64", 13: "TYPE_STRING", } _NAMES_TO_VALUES = { "TYPE_INVALID": 0, "TYPE_BOOL": 1, "TYPE_UINT8": 2, "TYPE_UINT16": 3, "TYPE_UINT32": 4, "TYPE_UINT64": 5, "TYPE_INT8": 6, "TYPE_INT16": 7, "TYPE_INT32": 8, "TYPE_INT64": 9, "TYPE_FP16": 10, "TYPE_FP32": 11, "TYPE_FP64": 12, "TYPE_STRING": 13, } fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/status/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/status/__init__.py ===== __all__ = ['ttypes', 'constants'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/status/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport all_structs = [] class RequestStatusCode(object): INVALID = 0 SUCCESS = 1 UNKNOWN = 2 INTERNAL = 3 NOT_FOUND = 4 INVALID_ARG = 5 UNAVAILABLE = 6 UNSUPPORTED = 7 ALREADY_EXISTS = 8 _VALUES_TO_NAMES = { 0: "INVALID", 1: "SUCCESS", 2: "UNKNOWN", 3: "INTERNAL", 4: "NOT_FOUND", 5: "INVALID_ARG", 6: "UNAVAILABLE", 7: "UNSUPPORTED", 8: "ALREADY_EXISTS", } _NAMES_TO_VALUES = { "INVALID": 0, "SUCCESS": 1, "UNKNOWN": 2, "INTERNAL": 3, "NOT_FOUND": 4, "INVALID_ARG": 5, "UNAVAILABLE": 6, "UNSUPPORTED": 7, "ALREADY_EXISTS": 8, } class ModelReadyState(object): MODEL_UNKNOWN = 0 MODEL_READY = 1 MODEL_UNAVAILABLE = 2 _VALUES_TO_NAMES = { 0: "MODEL_UNKNOWN", 1: "MODEL_READY", 2: "MODEL_UNAVAILABLE", } _NAMES_TO_VALUES = { "MODEL_UNKNOWN": 0, "MODEL_READY": 1, "MODEL_UNAVAILABLE": 2, } class ServerReadyState(object): SERVER_INVALID = 0 SERVER_INITIALIZING = 1 SERVER_READY = 2 SERVER_EXITING = 3 SERVER_FAILED_TO_INITIALIZE = 10 _VALUES_TO_NAMES = { 0: "SERVER_INVALID", 1: "SERVER_INITIALIZING", 2: "SERVER_READY", 3: "SERVER_EXITING", 10: "SERVER_FAILED_TO_INITIALIZE", } _NAMES_TO_VALUES = { "SERVER_INVALID": 0, "SERVER_INITIALIZING": 1, "SERVER_READY": 2, "SERVER_EXITING": 3, "SERVER_FAILED_TO_INITIALIZE": 10, } class RequestStatus(object): """ Attributes: - code - msg - server_id - request_id """ def __init__(self, code=None, msg=None, server_id=None, request_id=None,): self.code = code self.msg = msg self.server_id = server_id self.request_id = request_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.code = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.msg = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.server_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I64: self.request_id = iprot.readI64() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('RequestStatus') if self.code is not None: oprot.writeFieldBegin('code', TType.I32, 1) oprot.writeI32(self.code) oprot.writeFieldEnd() if self.msg is not None: oprot.writeFieldBegin('msg', TType.STRING, 2) oprot.writeString(self.msg.encode('utf-8') if sys.version_info[0] == 2 else self.msg) oprot.writeFieldEnd() if self.server_id is not None: oprot.writeFieldBegin('server_id', TType.STRING, 3) oprot.writeString(self.server_id.encode('utf-8') if sys.version_info[0] == 2 else self.server_id) oprot.writeFieldEnd() if self.request_id is not None: oprot.writeFieldBegin('request_id', TType.I64, 4) oprot.writeI64(self.request_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.code is None: raise TProtocolException(message='Required field code is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ModelVersionStatus(object): """ Attributes: - ready_state """ def __init__(self, ready_state=None,): self.ready_state = ready_state def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.ready_state = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ModelVersionStatus') if self.ready_state is not None: oprot.writeFieldBegin('ready_state', TType.I32, 1) oprot.writeI32(self.ready_state) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ModelInstanceStatus(object): """ Attributes: - version_status """ def __init__(self, version_status=None,): self.version_status = version_status def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.version_status = {} (_ktype1, _vtype2, _size0) = iprot.readMapBegin() for _i4 in range(_size0): _key5 = iprot.readI64() _val6 = ModelVersionStatus() _val6.read(iprot) self.version_status[_key5] = _val6 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ModelInstanceStatus') if self.version_status is not None: oprot.writeFieldBegin('version_status', TType.MAP, 1) oprot.writeMapBegin(TType.I64, TType.STRUCT, len(self.version_status)) for kiter7, viter8 in self.version_status.items(): oprot.writeI64(kiter7) viter8.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ServerStatus(object): """ Attributes: - id - version - model_status - ready_state """ def __init__(self, id=None, version=None, model_status=None, ready_state=None,): self.id = id self.version = version self.model_status = model_status self.ready_state = ready_state def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.model_status = {} (_ktype10, _vtype11, _size9) = iprot.readMapBegin() for _i13 in range(_size9): _key14 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val15 = ModelInstanceStatus() _val15.read(iprot) self.model_status[_key14] = _val15 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.ready_state = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ServerStatus') if self.id is not None: oprot.writeFieldBegin('id', TType.STRING, 1) oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id) oprot.writeFieldEnd() if self.version is not None: oprot.writeFieldBegin('version', TType.STRING, 2) oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version) oprot.writeFieldEnd() if self.model_status is not None: oprot.writeFieldBegin('model_status', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.model_status)) for kiter16, viter17 in self.model_status.items(): oprot.writeString(kiter16.encode('utf-8') if sys.version_info[0] == 2 else kiter16) viter17.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.ready_state is not None: oprot.writeFieldBegin('ready_state', TType.I32, 4) oprot.writeI32(self.ready_state) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(RequestStatus) RequestStatus.thrift_spec = ( None, # 0 (1, TType.I32, 'code', None, None, ), # 1 (2, TType.STRING, 'msg', 'UTF8', None, ), # 2 (3, TType.STRING, 'server_id', 'UTF8', None, ), # 3 (4, TType.I64, 'request_id', None, None, ), # 4 ) all_structs.append(ModelVersionStatus) ModelVersionStatus.thrift_spec = ( None, # 0 (1, TType.I32, 'ready_state', None, None, ), # 1 ) all_structs.append(ModelInstanceStatus) ModelInstanceStatus.thrift_spec = ( None, # 0 (1, TType.MAP, 'version_status', (TType.I64, None, TType.STRUCT, [ModelVersionStatus, None], False), None, ), # 1 ) all_structs.append(ServerStatus) ServerStatus.thrift_spec = ( None, # 0 (1, TType.STRING, 'id', 'UTF8', None, ), # 1 (2, TType.STRING, 'version', 'UTF8', None, ), # 2 (3, TType.MAP, 'model_status', (TType.STRING, 'UTF8', TType.STRUCT, [ModelInstanceStatus, None], False), None, ), # 3 (4, TType.I32, 'ready_state', None, None, ), # 4 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/__init__.py ===== __all__ = ['ttypes', 'constants', 'InferService'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import aimedia.inferservice.modelapi.ttypes import aimedia.inferservice.status.ttypes from thrift.transport import TTransport all_structs = [] class StatusRequest(object): """ Attributes: - model_name """ def __init__(self, model_name=None,): self.model_name = model_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.model_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('StatusRequest') if self.model_name is not None: oprot.writeFieldBegin('model_name', TType.STRING, 1) oprot.writeString(self.model_name.encode('utf-8') if sys.version_info[0] == 2 else self.model_name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.model_name is None: raise TProtocolException(message='Required field model_name is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class StatusResponse(object): """ Attributes: - request_status - server_status """ def __init__(self, request_status=None, server_status=None,): self.request_status = request_status self.server_status = server_status def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request_status = aimedia.inferservice.status.ttypes.RequestStatus() self.request_status.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.server_status = aimedia.inferservice.status.ttypes.ServerStatus() self.server_status.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('StatusResponse') if self.request_status is not None: oprot.writeFieldBegin('request_status', TType.STRUCT, 1) self.request_status.write(oprot) oprot.writeFieldEnd() if self.server_status is not None: oprot.writeFieldBegin('server_status', TType.STRUCT, 2) self.server_status.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.request_status is None: raise TProtocolException(message='Required field request_status is unset!') if self.server_status is None: raise TProtocolException(message='Required field server_status is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class HealthRequest(object): """ Attributes: - mode """ def __init__(self, mode=None,): self.mode = mode def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.mode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('HealthRequest') if self.mode is not None: oprot.writeFieldBegin('mode', TType.STRING, 1) oprot.writeString(self.mode.encode('utf-8') if sys.version_info[0] == 2 else self.mode) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class HealthResponse(object): """ Attributes: - request_status - health """ def __init__(self, request_status=None, health=None,): self.request_status = request_status self.health = health def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request_status = aimedia.inferservice.status.ttypes.RequestStatus() self.request_status.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: self.health = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('HealthResponse') if self.request_status is not None: oprot.writeFieldBegin('request_status', TType.STRUCT, 1) self.request_status.write(oprot) oprot.writeFieldEnd() if self.health is not None: oprot.writeFieldBegin('health', TType.BOOL, 2) oprot.writeBool(self.health) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferRequest(object): """ Attributes: - model_name - model_version - meta_data - raw_input """ def __init__(self, model_name=None, model_version=None, meta_data=None, raw_input=None,): self.model_name = model_name self.model_version = model_version self.meta_data = meta_data self.raw_input = raw_input def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.model_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.model_version = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.meta_data = aimedia.inferservice.modelapi.ttypes.InferRequestHeader() self.meta_data.read(iprot) else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.raw_input = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = iprot.readBinary() self.raw_input.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferRequest') if self.model_name is not None: oprot.writeFieldBegin('model_name', TType.STRING, 1) oprot.writeString(self.model_name.encode('utf-8') if sys.version_info[0] == 2 else self.model_name) oprot.writeFieldEnd() if self.model_version is not None: oprot.writeFieldBegin('model_version', TType.I64, 2) oprot.writeI64(self.model_version) oprot.writeFieldEnd() if self.meta_data is not None: oprot.writeFieldBegin('meta_data', TType.STRUCT, 3) self.meta_data.write(oprot) oprot.writeFieldEnd() if self.raw_input is not None: oprot.writeFieldBegin('raw_input', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.raw_input)) for iter6 in self.raw_input: oprot.writeBinary(iter6) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferResponse(object): """ Attributes: - request_status - meta_data - raw_output """ def __init__(self, request_status=None, meta_data=None, raw_output=None,): self.request_status = request_status self.meta_data = meta_data self.raw_output = raw_output def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.request_status = aimedia.inferservice.status.ttypes.RequestStatus() self.request_status.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.meta_data = aimedia.inferservice.modelapi.ttypes.InferResponseHeader() self.meta_data.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.raw_output = [] (_etype10, _size7) = iprot.readListBegin() for _i11 in range(_size7): _elem12 = iprot.readBinary() self.raw_output.append(_elem12) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferResponse') if self.request_status is not None: oprot.writeFieldBegin('request_status', TType.STRUCT, 1) self.request_status.write(oprot) oprot.writeFieldEnd() if self.meta_data is not None: oprot.writeFieldBegin('meta_data', TType.STRUCT, 2) self.meta_data.write(oprot) oprot.writeFieldEnd() if self.raw_output is not None: oprot.writeFieldBegin('raw_output', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.raw_output)) for iter13 in self.raw_output: oprot.writeBinary(iter13) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(StatusRequest) StatusRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'model_name', 'UTF8', None, ), # 1 ) all_structs.append(StatusResponse) StatusResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request_status', [aimedia.inferservice.status.ttypes.RequestStatus, None], None, ), # 1 (2, TType.STRUCT, 'server_status', [aimedia.inferservice.status.ttypes.ServerStatus, None], None, ), # 2 ) all_structs.append(HealthRequest) HealthRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'mode', 'UTF8', None, ), # 1 ) all_structs.append(HealthResponse) HealthResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request_status', [aimedia.inferservice.status.ttypes.RequestStatus, None], None, ), # 1 (2, TType.BOOL, 'health', None, None, ), # 2 ) all_structs.append(InferRequest) InferRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'model_name', 'UTF8', None, ), # 1 (2, TType.I64, 'model_version', None, None, ), # 2 (3, TType.STRUCT, 'meta_data', [aimedia.inferservice.modelapi.ttypes.InferRequestHeader, None], None, ), # 3 (4, TType.LIST, 'raw_input', (TType.STRING, 'BINARY', False), None, ), # 4 ) all_structs.append(InferResponse) InferResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request_status', [aimedia.inferservice.status.ttypes.RequestStatus, None], None, ), # 1 (2, TType.STRUCT, 'meta_data', [aimedia.inferservice.modelapi.ttypes.InferResponseHeader, None], None, ), # 2 (3, TType.LIST, 'raw_output', (TType.STRING, 'BINARY', False), None, ), # 3 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/modelapi/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/modelapi/__init__.py ===== __all__ = ['ttypes', 'constants'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/inferservice/modelapi/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import aimedia.inferservice.datatype.ttypes from thrift.transport import TTransport all_structs = [] class InferSharedMemory(object): """ Attributes: - key - region_byte_size - offset - data_byte_size - reuse_object """ def __init__(self, key=None, region_byte_size=None, offset=None, data_byte_size=None, reuse_object=None,): self.key = key self.region_byte_size = region_byte_size self.offset = offset self.data_byte_size = data_byte_size self.reuse_object = reuse_object def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.region_byte_size = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.offset = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.data_byte_size = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.reuse_object = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferSharedMemory') if self.key is not None: oprot.writeFieldBegin('key', TType.STRING, 1) oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key) oprot.writeFieldEnd() if self.region_byte_size is not None: oprot.writeFieldBegin('region_byte_size', TType.I32, 2) oprot.writeI32(self.region_byte_size) oprot.writeFieldEnd() if self.offset is not None: oprot.writeFieldBegin('offset', TType.I64, 3) oprot.writeI64(self.offset) oprot.writeFieldEnd() if self.data_byte_size is not None: oprot.writeFieldBegin('data_byte_size', TType.I32, 4) oprot.writeI32(self.data_byte_size) oprot.writeFieldEnd() if self.reuse_object is not None: oprot.writeFieldBegin('reuse_object', TType.BOOL, 5) oprot.writeBool(self.reuse_object) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.key is None: raise TProtocolException(message='Required field key is unset!') if self.region_byte_size is None: raise TProtocolException(message='Required field region_byte_size is unset!') if self.offset is None: raise TProtocolException(message='Required field offset is unset!') if self.data_byte_size is None: raise TProtocolException(message='Required field data_byte_size is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferTensor(object): """ Attributes: - name - dims - batch_byte_size - data_type - raw_data - shared_memory """ def __init__(self, name=None, dims=None, batch_byte_size=None, data_type=None, raw_data=None, shared_memory=None,): self.name = name self.dims = dims self.batch_byte_size = batch_byte_size self.data_type = data_type self.raw_data = raw_data self.shared_memory = shared_memory def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dims = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = iprot.readI64() self.dims.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.batch_byte_size = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.data_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.raw_data = iprot.readBinary() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: self.shared_memory = InferSharedMemory() self.shared_memory.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferTensor') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.dims is not None: oprot.writeFieldBegin('dims', TType.LIST, 2) oprot.writeListBegin(TType.I64, len(self.dims)) for iter6 in self.dims: oprot.writeI64(iter6) oprot.writeListEnd() oprot.writeFieldEnd() if self.batch_byte_size is not None: oprot.writeFieldBegin('batch_byte_size', TType.I64, 3) oprot.writeI64(self.batch_byte_size) oprot.writeFieldEnd() if self.data_type is not None: oprot.writeFieldBegin('data_type', TType.I32, 4) oprot.writeI32(self.data_type) oprot.writeFieldEnd() if self.raw_data is not None: oprot.writeFieldBegin('raw_data', TType.STRING, 5) oprot.writeBinary(self.raw_data) oprot.writeFieldEnd() if self.shared_memory is not None: oprot.writeFieldBegin('shared_memory', TType.STRUCT, 6) self.shared_memory.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: raise TProtocolException(message='Required field name is unset!') if self.dims is None: raise TProtocolException(message='Required field dims is unset!') if self.batch_byte_size is None: raise TProtocolException(message='Required field batch_byte_size is unset!') if self.data_type is None: raise TProtocolException(message='Required field data_type is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferRequestInput(object): """ Attributes: - name - dims - batch_byte_size - data_type """ def __init__(self, name=None, dims=None, batch_byte_size=None, data_type=None,): self.name = name self.dims = dims self.batch_byte_size = batch_byte_size self.data_type = data_type def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dims = [] (_etype10, _size7) = iprot.readListBegin() for _i11 in range(_size7): _elem12 = iprot.readI64() self.dims.append(_elem12) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.batch_byte_size = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.data_type = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferRequestInput') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.dims is not None: oprot.writeFieldBegin('dims', TType.LIST, 2) oprot.writeListBegin(TType.I64, len(self.dims)) for iter13 in self.dims: oprot.writeI64(iter13) oprot.writeListEnd() oprot.writeFieldEnd() if self.batch_byte_size is not None: oprot.writeFieldBegin('batch_byte_size', TType.I64, 3) oprot.writeI64(self.batch_byte_size) oprot.writeFieldEnd() if self.data_type is not None: oprot.writeFieldBegin('data_type', TType.I32, 4) oprot.writeI32(self.data_type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: raise TProtocolException(message='Required field name is unset!') if self.dims is None: raise TProtocolException(message='Required field dims is unset!') if self.batch_byte_size is None: raise TProtocolException(message='Required field batch_byte_size is unset!') if self.data_type is None: raise TProtocolException(message='Required field data_type is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferRequestOutput(object): """ Attributes: - name """ def __init__(self, name=None,): self.name = name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferRequestOutput') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: raise TProtocolException(message='Required field name is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferResponseOutput(object): """ Attributes: - name - dims - batch_byte_size - data_type """ def __init__(self, name=None, dims=None, batch_byte_size=None, data_type=None,): self.name = name self.dims = dims self.batch_byte_size = batch_byte_size self.data_type = data_type def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dims = [] (_etype17, _size14) = iprot.readListBegin() for _i18 in range(_size14): _elem19 = iprot.readI64() self.dims.append(_elem19) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.batch_byte_size = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.data_type = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferResponseOutput') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.dims is not None: oprot.writeFieldBegin('dims', TType.LIST, 2) oprot.writeListBegin(TType.I64, len(self.dims)) for iter20 in self.dims: oprot.writeI64(iter20) oprot.writeListEnd() oprot.writeFieldEnd() if self.batch_byte_size is not None: oprot.writeFieldBegin('batch_byte_size', TType.I64, 3) oprot.writeI64(self.batch_byte_size) oprot.writeFieldEnd() if self.data_type is not None: oprot.writeFieldBegin('data_type', TType.I32, 4) oprot.writeI32(self.data_type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: raise TProtocolException(message='Required field name is unset!') if self.dims is None: raise TProtocolException(message='Required field dims is unset!') if self.data_type is None: raise TProtocolException(message='Required field data_type is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferRequestHeader(object): """ Attributes: - batch_size - id - input - output - shared_memory """ def __init__(self, batch_size=None, id=None, input=None, output=None, shared_memory=None,): self.batch_size = batch_size self.id = id self.input = input self.output = output self.shared_memory = shared_memory def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.batch_size = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.id = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.input = [] (_etype24, _size21) = iprot.readListBegin() for _i25 in range(_size21): _elem26 = InferRequestInput() _elem26.read(iprot) self.input.append(_elem26) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.output = [] (_etype30, _size27) = iprot.readListBegin() for _i31 in range(_size27): _elem32 = InferRequestOutput() _elem32.read(iprot) self.output.append(_elem32) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.shared_memory = InferSharedMemory() self.shared_memory.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferRequestHeader') if self.batch_size is not None: oprot.writeFieldBegin('batch_size', TType.I32, 1) oprot.writeI32(self.batch_size) oprot.writeFieldEnd() if self.id is not None: oprot.writeFieldBegin('id', TType.I64, 2) oprot.writeI64(self.id) oprot.writeFieldEnd() if self.input is not None: oprot.writeFieldBegin('input', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.input)) for iter33 in self.input: iter33.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.output is not None: oprot.writeFieldBegin('output', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.output)) for iter34 in self.output: iter34.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.shared_memory is not None: oprot.writeFieldBegin('shared_memory', TType.STRUCT, 5) self.shared_memory.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.input is None: raise TProtocolException(message='Required field input is unset!') if self.output is None: raise TProtocolException(message='Required field output is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class InferResponseHeader(object): """ Attributes: - id - output - shared_memory """ def __init__(self, id=None, output=None, shared_memory=None,): self.id = id self.output = output self.shared_memory = shared_memory def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.id = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.output = [] (_etype38, _size35) = iprot.readListBegin() for _i39 in range(_size35): _elem40 = InferResponseOutput() _elem40.read(iprot) self.output.append(_elem40) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.shared_memory = InferSharedMemory() self.shared_memory.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InferResponseHeader') if self.id is not None: oprot.writeFieldBegin('id', TType.I64, 1) oprot.writeI64(self.id) oprot.writeFieldEnd() if self.output is not None: oprot.writeFieldBegin('output', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.output)) for iter41 in self.output: iter41.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.shared_memory is not None: oprot.writeFieldBegin('shared_memory', TType.STRUCT, 3) self.shared_memory.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.output is None: raise TProtocolException(message='Required field output is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(InferSharedMemory) InferSharedMemory.thrift_spec = ( None, # 0 (1, TType.STRING, 'key', 'UTF8', None, ), # 1 (2, TType.I32, 'region_byte_size', None, None, ), # 2 (3, TType.I64, 'offset', None, None, ), # 3 (4, TType.I32, 'data_byte_size', None, None, ), # 4 (5, TType.BOOL, 'reuse_object', None, None, ), # 5 ) all_structs.append(InferTensor) InferTensor.thrift_spec = ( None, # 0 (1, TType.STRING, 'name', 'UTF8', None, ), # 1 (2, TType.LIST, 'dims', (TType.I64, None, False), None, ), # 2 (3, TType.I64, 'batch_byte_size', None, None, ), # 3 (4, TType.I32, 'data_type', None, None, ), # 4 (5, TType.STRING, 'raw_data', 'BINARY', None, ), # 5 (6, TType.STRUCT, 'shared_memory', [InferSharedMemory, None], None, ), # 6 ) all_structs.append(InferRequestInput) InferRequestInput.thrift_spec = ( None, # 0 (1, TType.STRING, 'name', 'UTF8', None, ), # 1 (2, TType.LIST, 'dims', (TType.I64, None, False), None, ), # 2 (3, TType.I64, 'batch_byte_size', None, None, ), # 3 (4, TType.I32, 'data_type', None, None, ), # 4 ) all_structs.append(InferRequestOutput) InferRequestOutput.thrift_spec = ( None, # 0 (1, TType.STRING, 'name', 'UTF8', None, ), # 1 ) all_structs.append(InferResponseOutput) InferResponseOutput.thrift_spec = ( None, # 0 (1, TType.STRING, 'name', 'UTF8', None, ), # 1 (2, TType.LIST, 'dims', (TType.I64, None, False), None, ), # 2 (3, TType.I64, 'batch_byte_size', None, None, ), # 3 (4, TType.I32, 'data_type', None, None, ), # 4 ) all_structs.append(InferRequestHeader) InferRequestHeader.thrift_spec = ( None, # 0 (1, TType.I32, 'batch_size', None, None, ), # 1 (2, TType.I64, 'id', None, None, ), # 2 (3, TType.LIST, 'input', (TType.STRUCT, [InferRequestInput, None], False), None, ), # 3 (4, TType.LIST, 'output', (TType.STRUCT, [InferRequestOutput, None], False), None, ), # 4 (5, TType.STRUCT, 'shared_memory', [InferSharedMemory, None], None, ), # 5 ) all_structs.append(InferResponseHeader) InferResponseHeader.thrift_spec = ( None, # 0 (1, TType.I64, 'id', None, None, ), # 1 (2, TType.LIST, 'output', (TType.STRUCT, [InferResponseOutput, None], False), None, ), # 2 (3, TType.STRUCT, 'shared_memory', [InferSharedMemory, None], None, ), # 3 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/modelinterface/constants.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from .ttypes import * ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/modelinterface/AIModelService.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): def ping(self): pass def bizIDQuery(self, context, bizIDRequest): """ Parameters: - context - bizIDRequest """ pass def resourceQuery(self, context, resourceRequest): """ Parameters: - context - resourceRequest """ pass class Client(Iface): def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def ping(self): self.send_ping() self.recv_ping() def send_ping(self): self._oprot.writeMessageBegin('ping', TMessageType.CALL, self._seqid) args = ping_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_ping(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = ping_result() result.read(iprot) iprot.readMessageEnd() return def bizIDQuery(self, context, bizIDRequest): """ Parameters: - context - bizIDRequest """ self.send_bizIDQuery(context, bizIDRequest) return self.recv_bizIDQuery() def send_bizIDQuery(self, context, bizIDRequest): self._oprot.writeMessageBegin('bizIDQuery', TMessageType.CALL, self._seqid) args = bizIDQuery_args() args.context = context args.bizIDRequest = bizIDRequest args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_bizIDQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = bizIDQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "bizIDQuery failed: unknown result") def resourceQuery(self, context, resourceRequest): """ Parameters: - context - resourceRequest """ self.send_resourceQuery(context, resourceRequest) return self.recv_resourceQuery() def send_resourceQuery(self, context, resourceRequest): self._oprot.writeMessageBegin('resourceQuery', TMessageType.CALL, self._seqid) args = resourceQuery_args() args.context = context args.resourceRequest = resourceRequest args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_resourceQuery(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = resourceQuery_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "resourceQuery failed: unknown result") class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["ping"] = Processor.process_ping self._processMap["bizIDQuery"] = Processor.process_bizIDQuery self._processMap["resourceQuery"] = Processor.process_resourceQuery def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_ping(self, seqid, iprot, oprot): args = ping_args() args.read(iprot) iprot.readMessageEnd() result = ping_result() try: self._handler.ping() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("ping", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_bizIDQuery(self, seqid, iprot, oprot): args = bizIDQuery_args() args.read(iprot) iprot.readMessageEnd() result = bizIDQuery_result() try: result.success = self._handler.bizIDQuery(args.context, args.bizIDRequest) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("bizIDQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_resourceQuery(self, seqid, iprot, oprot): args = resourceQuery_args() args.read(iprot) iprot.readMessageEnd() result = resourceQuery_result() try: result.success = self._handler.resourceQuery(args.context, args.resourceRequest) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("resourceQuery", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class ping_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_args) ping_args.thrift_spec = ( ) class ping_result(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ping_result') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(ping_result) ping_result.thrift_spec = ( ) class bizIDQuery_args(object): """ Attributes: - context - bizIDRequest """ def __init__(self, context=None, bizIDRequest=None,): self.context = context self.bizIDRequest = bizIDRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.context = infra.rpc.base.ttypes.Context() self.context.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.bizIDRequest = BizIDRequest() self.bizIDRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('bizIDQuery_args') if self.context is not None: oprot.writeFieldBegin('context', TType.STRUCT, 1) self.context.write(oprot) oprot.writeFieldEnd() if self.bizIDRequest is not None: oprot.writeFieldBegin('bizIDRequest', TType.STRUCT, 2) self.bizIDRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(bizIDQuery_args) bizIDQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'context', [infra.rpc.base.ttypes.Context, None], None, ), # 1 (2, TType.STRUCT, 'bizIDRequest', [BizIDRequest, None], None, ), # 2 ) class bizIDQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = BizIDResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('bizIDQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(bizIDQuery_result) bizIDQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [BizIDResponse, None], None, ), # 0 ) class resourceQuery_args(object): """ Attributes: - context - resourceRequest """ def __init__(self, context=None, resourceRequest=None,): self.context = context self.resourceRequest = resourceRequest def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.context = infra.rpc.base.ttypes.Context() self.context.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.resourceRequest = ResourceRequest() self.resourceRequest.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('resourceQuery_args') if self.context is not None: oprot.writeFieldBegin('context', TType.STRUCT, 1) self.context.write(oprot) oprot.writeFieldEnd() if self.resourceRequest is not None: oprot.writeFieldBegin('resourceRequest', TType.STRUCT, 2) self.resourceRequest.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(resourceQuery_args) resourceQuery_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'context', [infra.rpc.base.ttypes.Context, None], None, ), # 1 (2, TType.STRUCT, 'resourceRequest', [ResourceRequest, None], None, ), # 2 ) class resourceQuery_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = ResourceResponse() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('resourceQuery_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(resourceQuery_result) resourceQuery_result.thrift_spec = ( (0, TType.STRUCT, 'success', [ResourceResponse, None], None, ), # 0 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/modelinterface/__init__.py ===== __all__ = ['ttypes', 'constants', 'AIModelService'] ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/modelinterface/ttypes.py ===== # # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import infra.rpc.base.ttypes from thrift.transport import TTransport all_structs = [] class RequestType(object): ONLINE_DATA = 0 EXTRA_DATA = 1 _VALUES_TO_NAMES = { 0: "ONLINE_DATA", 1: "EXTRA_DATA", } _NAMES_TO_VALUES = { "ONLINE_DATA": 0, "EXTRA_DATA": 1, } class SourceType(object): NOTE = 0 TOP = 1 _VALUES_TO_NAMES = { 0: "NOTE", 1: "TOP", } _NAMES_TO_VALUES = { "NOTE": 0, "TOP": 1, } class FeatureType(object): INT32 = 1 DOUBLE = 2 BINARY = 3 STRING = 4 INT32_LIST = 5 DOUBLE_LIST = 6 BINARY_LIST = 7 STRING_LIST = 8 STRING_DOUBLE_MAP = 9 DOUBLE_2D_LIST = 10 _VALUES_TO_NAMES = { 1: "INT32", 2: "DOUBLE", 3: "BINARY", 4: "STRING", 5: "INT32_LIST", 6: "DOUBLE_LIST", 7: "BINARY_LIST", 8: "STRING_LIST", 9: "STRING_DOUBLE_MAP", 10: "DOUBLE_2D_LIST", } _NAMES_TO_VALUES = { "INT32": 1, "DOUBLE": 2, "BINARY": 3, "STRING": 4, "INT32_LIST": 5, "DOUBLE_LIST": 6, "BINARY_LIST": 7, "STRING_LIST": 8, "STRING_DOUBLE_MAP": 9, "DOUBLE_2D_LIST": 10, } class ModelStatus(object): SUCCEED_NORMAL = 0 SUCCEED_HIT = 1 PROCESSING = 2 FAIL = 3 ERROR_UKNOWN = 100 ERROR_URL_DOWNLOAD = 101 ERROR_DB_RED_KEY = 102 ERROR_CV_ERR = 601 ERROR_IMAGE_PREPROCESS = 602 ERROR_MODEL_INFERENCE = 603 _VALUES_TO_NAMES = { 0: "SUCCEED_NORMAL", 1: "SUCCEED_HIT", 2: "PROCESSING", 3: "FAIL", 100: "ERROR_UKNOWN", 101: "ERROR_URL_DOWNLOAD", 102: "ERROR_DB_RED_KEY", 601: "ERROR_CV_ERR", 602: "ERROR_IMAGE_PREPROCESS", 603: "ERROR_MODEL_INFERENCE", } _NAMES_TO_VALUES = { "SUCCEED_NORMAL": 0, "SUCCEED_HIT": 1, "PROCESSING": 2, "FAIL": 3, "ERROR_UKNOWN": 100, "ERROR_URL_DOWNLOAD": 101, "ERROR_DB_RED_KEY": 102, "ERROR_CV_ERR": 601, "ERROR_IMAGE_PREPROCESS": 602, "ERROR_MODEL_INFERENCE": 603, } class Feature(object): """ Attributes: - type - int32Value - doubleValue - binaryValue - stringValue - int32ListValue - doubleListValue - binaryListValue - stringListValue - stringDoubleMapValue - double2DList """ def __init__(self, type=None, int32Value=None, doubleValue=None, binaryValue=None, stringValue=None, int32ListValue=None, doubleListValue=None, binaryListValue=None, stringListValue=None, stringDoubleMapValue=None, double2DList=None,): self.type = type self.int32Value = int32Value self.doubleValue = doubleValue self.binaryValue = binaryValue self.stringValue = stringValue self.int32ListValue = int32ListValue self.doubleListValue = doubleListValue self.binaryListValue = binaryListValue self.stringListValue = stringListValue self.stringDoubleMapValue = stringDoubleMapValue self.double2DList = double2DList def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.type = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.int32Value = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.doubleValue = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.binaryValue = iprot.readBinary() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.int32ListValue = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = iprot.readI32() self.int32ListValue.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.doubleListValue = [] (_etype9, _size6) = iprot.readListBegin() for _i10 in range(_size6): _elem11 = iprot.readDouble() self.doubleListValue.append(_elem11) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.binaryListValue = [] (_etype15, _size12) = iprot.readListBegin() for _i16 in range(_size12): _elem17 = iprot.readBinary() self.binaryListValue.append(_elem17) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.stringListValue = [] (_etype21, _size18) = iprot.readListBegin() for _i22 in range(_size18): _elem23 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.stringListValue.append(_elem23) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.MAP: self.stringDoubleMapValue = {} (_ktype25, _vtype26, _size24) = iprot.readMapBegin() for _i28 in range(_size24): _key29 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val30 = iprot.readDouble() self.stringDoubleMapValue[_key29] = _val30 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.double2DList = [] (_etype34, _size31) = iprot.readListBegin() for _i35 in range(_size31): _elem36 = [] (_etype40, _size37) = iprot.readListBegin() for _i41 in range(_size37): _elem42 = iprot.readDouble() _elem36.append(_elem42) iprot.readListEnd() self.double2DList.append(_elem36) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Feature') if self.type is not None: oprot.writeFieldBegin('type', TType.I32, 1) oprot.writeI32(self.type) oprot.writeFieldEnd() if self.int32Value is not None: oprot.writeFieldBegin('int32Value', TType.I32, 2) oprot.writeI32(self.int32Value) oprot.writeFieldEnd() if self.doubleValue is not None: oprot.writeFieldBegin('doubleValue', TType.DOUBLE, 3) oprot.writeDouble(self.doubleValue) oprot.writeFieldEnd() if self.binaryValue is not None: oprot.writeFieldBegin('binaryValue', TType.STRING, 4) oprot.writeBinary(self.binaryValue) oprot.writeFieldEnd() if self.stringValue is not None: oprot.writeFieldBegin('stringValue', TType.STRING, 5) oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue) oprot.writeFieldEnd() if self.int32ListValue is not None: oprot.writeFieldBegin('int32ListValue', TType.LIST, 6) oprot.writeListBegin(TType.I32, len(self.int32ListValue)) for iter43 in self.int32ListValue: oprot.writeI32(iter43) oprot.writeListEnd() oprot.writeFieldEnd() if self.doubleListValue is not None: oprot.writeFieldBegin('doubleListValue', TType.LIST, 7) oprot.writeListBegin(TType.DOUBLE, len(self.doubleListValue)) for iter44 in self.doubleListValue: oprot.writeDouble(iter44) oprot.writeListEnd() oprot.writeFieldEnd() if self.binaryListValue is not None: oprot.writeFieldBegin('binaryListValue', TType.LIST, 8) oprot.writeListBegin(TType.STRING, len(self.binaryListValue)) for iter45 in self.binaryListValue: oprot.writeBinary(iter45) oprot.writeListEnd() oprot.writeFieldEnd() if self.stringListValue is not None: oprot.writeFieldBegin('stringListValue', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.stringListValue)) for iter46 in self.stringListValue: oprot.writeString(iter46.encode('utf-8') if sys.version_info[0] == 2 else iter46) oprot.writeListEnd() oprot.writeFieldEnd() if self.stringDoubleMapValue is not None: oprot.writeFieldBegin('stringDoubleMapValue', TType.MAP, 10) oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.stringDoubleMapValue)) for kiter47, viter48 in self.stringDoubleMapValue.items(): oprot.writeString(kiter47.encode('utf-8') if sys.version_info[0] == 2 else kiter47) oprot.writeDouble(viter48) oprot.writeMapEnd() oprot.writeFieldEnd() if self.double2DList is not None: oprot.writeFieldBegin('double2DList', TType.LIST, 11) oprot.writeListBegin(TType.LIST, len(self.double2DList)) for iter49 in self.double2DList: oprot.writeListBegin(TType.DOUBLE, len(iter49)) for iter50 in iter49: oprot.writeDouble(iter50) oprot.writeListEnd() oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BizIDRequest(object): """ Attributes: - bizID - serviceType - serviceName - sourceType - requestType """ def __init__(self, bizID=None, serviceType=None, serviceName=None, sourceType=None, requestType=None,): self.bizID = bizID self.serviceType = serviceType self.serviceName = serviceName self.sourceType = sourceType self.requestType = requestType def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.bizID = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.serviceType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.serviceName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.sourceType = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.requestType = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BizIDRequest') if self.bizID is not None: oprot.writeFieldBegin('bizID', TType.STRING, 1) oprot.writeString(self.bizID.encode('utf-8') if sys.version_info[0] == 2 else self.bizID) oprot.writeFieldEnd() if self.serviceType is not None: oprot.writeFieldBegin('serviceType', TType.STRING, 2) oprot.writeString(self.serviceType.encode('utf-8') if sys.version_info[0] == 2 else self.serviceType) oprot.writeFieldEnd() if self.serviceName is not None: oprot.writeFieldBegin('serviceName', TType.STRING, 3) oprot.writeString(self.serviceName.encode('utf-8') if sys.version_info[0] == 2 else self.serviceName) oprot.writeFieldEnd() if self.sourceType is not None: oprot.writeFieldBegin('sourceType', TType.I32, 4) oprot.writeI32(self.sourceType) oprot.writeFieldEnd() if self.requestType is not None: oprot.writeFieldBegin('requestType', TType.I32, 5) oprot.writeI32(self.requestType) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.bizID is None: raise TProtocolException(message='Required field bizID is unset!') if self.serviceType is None: raise TProtocolException(message='Required field serviceType is unset!') if self.sourceType is None: raise TProtocolException(message='Required field sourceType is unset!') if self.requestType is None: raise TProtocolException(message='Required field requestType is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ResourceRequest(object): """ Attributes: - serviceType - serviceName - requestType - requestData - featureData """ def __init__(self, serviceType=None, serviceName=None, requestType=None, requestData=None, featureData=None,): self.serviceType = serviceType self.serviceName = serviceName self.requestType = requestType self.requestData = requestData self.featureData = featureData def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.serviceType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.serviceName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.requestType = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.requestData = {} (_ktype52, _vtype53, _size51) = iprot.readMapBegin() for _i55 in range(_size51): _key56 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val57 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.requestData[_key56] = _val57 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.featureData = {} (_ktype59, _vtype60, _size58) = iprot.readMapBegin() for _i62 in range(_size58): _key63 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val64 = Feature() _val64.read(iprot) self.featureData[_key63] = _val64 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ResourceRequest') if self.serviceType is not None: oprot.writeFieldBegin('serviceType', TType.STRING, 1) oprot.writeString(self.serviceType.encode('utf-8') if sys.version_info[0] == 2 else self.serviceType) oprot.writeFieldEnd() if self.serviceName is not None: oprot.writeFieldBegin('serviceName', TType.STRING, 2) oprot.writeString(self.serviceName.encode('utf-8') if sys.version_info[0] == 2 else self.serviceName) oprot.writeFieldEnd() if self.requestType is not None: oprot.writeFieldBegin('requestType', TType.I32, 3) oprot.writeI32(self.requestType) oprot.writeFieldEnd() if self.requestData is not None: oprot.writeFieldBegin('requestData', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.requestData)) for kiter65, viter66 in self.requestData.items(): oprot.writeString(kiter65.encode('utf-8') if sys.version_info[0] == 2 else kiter65) oprot.writeString(viter66.encode('utf-8') if sys.version_info[0] == 2 else viter66) oprot.writeMapEnd() oprot.writeFieldEnd() if self.featureData is not None: oprot.writeFieldBegin('featureData', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.featureData)) for kiter67, viter68 in self.featureData.items(): oprot.writeString(kiter67.encode('utf-8') if sys.version_info[0] == 2 else kiter67) viter68.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.serviceType is None: raise TProtocolException(message='Required field serviceType is unset!') if self.requestType is None: raise TProtocolException(message='Required field requestType is unset!') if self.requestData is None: raise TProtocolException(message='Required field requestData is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class Coordinate(object): """ Attributes: - x - y """ def __init__(self, x=None, y=None,): self.x = x self.y = y def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.x = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.y = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Coordinate') if self.x is not None: oprot.writeFieldBegin('x', TType.I32, 1) oprot.writeI32(self.x) oprot.writeFieldEnd() if self.y is not None: oprot.writeFieldBegin('y', TType.I32, 2) oprot.writeI32(self.y) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.x is None: raise TProtocolException(message='Required field x is unset!') if self.y is None: raise TProtocolException(message='Required field y is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class TextOffset(object): """ Attributes: - text - offset - length """ def __init__(self, text=None, offset=None, length=None,): self.text = text self.offset = offset self.length = length def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.offset = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.length = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TextOffset') if self.text is not None: oprot.writeFieldBegin('text', TType.STRING, 1) oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) oprot.writeFieldEnd() if self.offset is not None: oprot.writeFieldBegin('offset', TType.I32, 2) oprot.writeI32(self.offset) oprot.writeFieldEnd() if self.length is not None: oprot.writeFieldBegin('length', TType.I32, 3) oprot.writeI32(self.length) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AreaInfo(object): """ Attributes: - areaRatio - width - height """ def __init__(self, areaRatio=None, width=None, height=None,): self.areaRatio = areaRatio self.width = width self.height = height def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.DOUBLE: self.areaRatio = iprot.readDouble() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.width = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.height = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('AreaInfo') if self.areaRatio is not None: oprot.writeFieldBegin('areaRatio', TType.DOUBLE, 1) oprot.writeDouble(self.areaRatio) oprot.writeFieldEnd() if self.width is not None: oprot.writeFieldBegin('width', TType.I32, 2) oprot.writeI32(self.width) oprot.writeFieldEnd() if self.height is not None: oprot.writeFieldBegin('height', TType.I32, 3) oprot.writeI32(self.height) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class LabelInfo(object): """ Attributes: - labelID - labelName - score - info - parrentLabelID - parrentLabelName """ def __init__(self, labelID=None, labelName=None, score=None, info=None, parrentLabelID=None, parrentLabelName=None,): self.labelID = labelID self.labelName = labelName self.score = score self.info = info self.parrentLabelID = parrentLabelID self.parrentLabelName = parrentLabelName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.labelID = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.labelName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.info = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.parrentLabelID = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.parrentLabelName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LabelInfo') if self.labelID is not None: oprot.writeFieldBegin('labelID', TType.I32, 1) oprot.writeI32(self.labelID) oprot.writeFieldEnd() if self.labelName is not None: oprot.writeFieldBegin('labelName', TType.STRING, 2) oprot.writeString(self.labelName.encode('utf-8') if sys.version_info[0] == 2 else self.labelName) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.info is not None: oprot.writeFieldBegin('info', TType.STRING, 4) oprot.writeString(self.info.encode('utf-8') if sys.version_info[0] == 2 else self.info) oprot.writeFieldEnd() if self.parrentLabelID is not None: oprot.writeFieldBegin('parrentLabelID', TType.I32, 5) oprot.writeI32(self.parrentLabelID) oprot.writeFieldEnd() if self.parrentLabelName is not None: oprot.writeFieldBegin('parrentLabelName', TType.STRING, 6) oprot.writeString(self.parrentLabelName.encode('utf-8') if sys.version_info[0] == 2 else self.parrentLabelName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class FeatureInfo(object): """ Attributes: - featureID - featureName - score - info - parrentFeatureID - parrentFeatureName """ def __init__(self, featureID=None, featureName=None, score=None, info=None, parrentFeatureID=None, parrentFeatureName=None,): self.featureID = featureID self.featureName = featureName self.score = score self.info = info self.parrentFeatureID = parrentFeatureID self.parrentFeatureName = parrentFeatureName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.featureID = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.featureName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.info = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.parrentFeatureID = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.parrentFeatureName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('FeatureInfo') if self.featureID is not None: oprot.writeFieldBegin('featureID', TType.I32, 1) oprot.writeI32(self.featureID) oprot.writeFieldEnd() if self.featureName is not None: oprot.writeFieldBegin('featureName', TType.STRING, 2) oprot.writeString(self.featureName.encode('utf-8') if sys.version_info[0] == 2 else self.featureName) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.info is not None: oprot.writeFieldBegin('info', TType.STRING, 4) oprot.writeString(self.info.encode('utf-8') if sys.version_info[0] == 2 else self.info) oprot.writeFieldEnd() if self.parrentFeatureID is not None: oprot.writeFieldBegin('parrentFeatureID', TType.I32, 5) oprot.writeI32(self.parrentFeatureID) oprot.writeFieldEnd() if self.parrentFeatureName is not None: oprot.writeFieldBegin('parrentFeatureName', TType.STRING, 6) oprot.writeString(self.parrentFeatureName.encode('utf-8') if sys.version_info[0] == 2 else self.parrentFeatureName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DetectInfo(object): """ Attributes: - instanceIndex - score - coordinates - labelInfos - instanceName - textOffset - areaInfo """ def __init__(self, instanceIndex=None, score=None, coordinates=None, labelInfos=None, instanceName=None, textOffset=None, areaInfo=None,): self.instanceIndex = instanceIndex self.score = score self.coordinates = coordinates self.labelInfos = labelInfos self.instanceName = instanceName self.textOffset = textOffset self.areaInfo = areaInfo def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.instanceIndex = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.coordinates = [] (_etype72, _size69) = iprot.readListBegin() for _i73 in range(_size69): _elem74 = Coordinate() _elem74.read(iprot) self.coordinates.append(_elem74) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.labelInfos = [] (_etype78, _size75) = iprot.readListBegin() for _i79 in range(_size75): _elem80 = LabelInfo() _elem80.read(iprot) self.labelInfos.append(_elem80) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.instanceName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRUCT: self.textOffset = TextOffset() self.textOffset.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: self.areaInfo = AreaInfo() self.areaInfo.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DetectInfo') if self.instanceIndex is not None: oprot.writeFieldBegin('instanceIndex', TType.I32, 1) oprot.writeI32(self.instanceIndex) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 2) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.coordinates is not None: oprot.writeFieldBegin('coordinates', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.coordinates)) for iter81 in self.coordinates: iter81.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.labelInfos is not None: oprot.writeFieldBegin('labelInfos', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.labelInfos)) for iter82 in self.labelInfos: iter82.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.instanceName is not None: oprot.writeFieldBegin('instanceName', TType.STRING, 5) oprot.writeString(self.instanceName.encode('utf-8') if sys.version_info[0] == 2 else self.instanceName) oprot.writeFieldEnd() if self.areaInfo is not None: oprot.writeFieldBegin('areaInfo', TType.STRUCT, 6) self.areaInfo.write(oprot) oprot.writeFieldEnd() if self.textOffset is not None: oprot.writeFieldBegin('textOffset', TType.STRUCT, 7) self.textOffset.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class LabelResponse(object): """ Attributes: - status - labelInfos - featureInfos """ def __init__(self, status=None, labelInfos=None, featureInfos=None,): self.status = status self.labelInfos = labelInfos self.featureInfos = featureInfos def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.status = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.labelInfos = [] (_etype86, _size83) = iprot.readListBegin() for _i87 in range(_size83): _elem88 = LabelInfo() _elem88.read(iprot) self.labelInfos.append(_elem88) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.featureInfos = [] (_etype92, _size89) = iprot.readListBegin() for _i93 in range(_size89): _elem94 = FeatureInfo() _elem94.read(iprot) self.featureInfos.append(_elem94) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LabelResponse') if self.status is not None: oprot.writeFieldBegin('status', TType.I32, 1) oprot.writeI32(self.status) oprot.writeFieldEnd() if self.labelInfos is not None: oprot.writeFieldBegin('labelInfos', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.labelInfos)) for iter95 in self.labelInfos: iter95.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.featureInfos is not None: oprot.writeFieldBegin('featureInfos', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.featureInfos)) for iter96 in self.featureInfos: iter96.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.status is None: raise TProtocolException(message='Required field status is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class DetectResponse(object): """ Attributes: - status - detectInfos """ def __init__(self, status=None, detectInfos=None,): self.status = status self.detectInfos = detectInfos def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.status = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.detectInfos = [] (_etype100, _size97) = iprot.readListBegin() for _i101 in range(_size97): _elem102 = DetectInfo() _elem102.read(iprot) self.detectInfos.append(_elem102) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('DetectResponse') if self.status is not None: oprot.writeFieldBegin('status', TType.I32, 1) oprot.writeI32(self.status) oprot.writeFieldEnd() if self.detectInfos is not None: oprot.writeFieldBegin('detectInfos', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.detectInfos)) for iter103 in self.detectInfos: iter103.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.status is None: raise TProtocolException(message='Required field status is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EmbeddingInfo(object): """ Attributes: - shape - embedding """ def __init__(self, shape=None, embedding=None,): self.shape = shape self.embedding = embedding def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.shape = [] (_etype107, _size104) = iprot.readListBegin() for _i108 in range(_size104): _elem109 = iprot.readI32() self.shape.append(_elem109) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.embedding = [] (_etype113, _size110) = iprot.readListBegin() for _i114 in range(_size110): _elem115 = iprot.readDouble() self.embedding.append(_elem115) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EmbeddingInfo') if self.shape is not None: oprot.writeFieldBegin('shape', TType.LIST, 1) oprot.writeListBegin(TType.I32, len(self.shape)) for iter116 in self.shape: oprot.writeI32(iter116) oprot.writeListEnd() oprot.writeFieldEnd() if self.embedding is not None: oprot.writeFieldBegin('embedding', TType.LIST, 2) oprot.writeListBegin(TType.DOUBLE, len(self.embedding)) for iter117 in self.embedding: oprot.writeDouble(iter117) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.embedding is None: raise TProtocolException(message='Required field embedding is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class EmbeddingResponse(object): """ Attributes: - status - embeddingInfos """ def __init__(self, status=None, embeddingInfos=None,): self.status = status self.embeddingInfos = embeddingInfos def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.status = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.embeddingInfos = [] (_etype121, _size118) = iprot.readListBegin() for _i122 in range(_size118): _elem123 = EmbeddingInfo() _elem123.read(iprot) self.embeddingInfos.append(_elem123) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('EmbeddingResponse') if self.status is not None: oprot.writeFieldBegin('status', TType.I32, 1) oprot.writeI32(self.status) oprot.writeFieldEnd() if self.embeddingInfos is not None: oprot.writeFieldBegin('embeddingInfos', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.embeddingInfos)) for iter124 in self.embeddingInfos: iter124.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.status is None: raise TProtocolException(message='Required field status is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ModelResultInfo(object): """ Attributes: - sourceType - label - score - labelResponse - detectResponse - embeddingResponse """ def __init__(self, sourceType=None, label=None, score=None, labelResponse=None, detectResponse=None, embeddingResponse=None,): self.sourceType = sourceType self.label = label self.score = score self.labelResponse = labelResponse self.detectResponse = detectResponse self.embeddingResponse = embeddingResponse def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.sourceType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.labelResponse = LabelResponse() self.labelResponse.read(iprot) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.detectResponse = DetectResponse() self.detectResponse.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: self.embeddingResponse = EmbeddingResponse() self.embeddingResponse.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ModelResultInfo') if self.sourceType is not None: oprot.writeFieldBegin('sourceType', TType.STRING, 1) oprot.writeString(self.sourceType.encode('utf-8') if sys.version_info[0] == 2 else self.sourceType) oprot.writeFieldEnd() if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 2) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 3) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.labelResponse is not None: oprot.writeFieldBegin('labelResponse', TType.STRUCT, 4) self.labelResponse.write(oprot) oprot.writeFieldEnd() if self.detectResponse is not None: oprot.writeFieldBegin('detectResponse', TType.STRUCT, 5) self.detectResponse.write(oprot) oprot.writeFieldEnd() if self.embeddingResponse is not None: oprot.writeFieldBegin('embeddingResponse', TType.STRUCT, 6) self.embeddingResponse.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ResourceResult(object): """ Attributes: - modelStatus - extraInfo - modelResult """ def __init__(self, modelStatus=None, extraInfo=None, modelResult=None,): self.modelStatus = modelStatus self.extraInfo = extraInfo self.modelResult = modelResult def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.modelStatus = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.extraInfo = [] (_etype128, _size125) = iprot.readListBegin() for _i129 in range(_size125): _elem130 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.extraInfo.append(_elem130) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.modelResult = ModelResultInfo() self.modelResult.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ResourceResult') if self.modelStatus is not None: oprot.writeFieldBegin('modelStatus', TType.I32, 1) oprot.writeI32(self.modelStatus) oprot.writeFieldEnd() if self.extraInfo is not None: oprot.writeFieldBegin('extraInfo', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.extraInfo)) for iter131 in self.extraInfo: oprot.writeString(iter131.encode('utf-8') if sys.version_info[0] == 2 else iter131) oprot.writeListEnd() oprot.writeFieldEnd() if self.modelResult is not None: oprot.writeFieldBegin('modelResult', TType.STRUCT, 3) self.modelResult.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.modelStatus is None: raise TProtocolException(message='Required field modelStatus is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ResourceResponse(object): """ Attributes: - result - resourceResult - featureData """ def __init__(self, result=None, resourceResult=None, featureData=None,): self.result = result self.resourceResult = resourceResult self.featureData = featureData def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.result = infra.rpc.base.ttypes.Result() self.result.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.resourceResult = ResourceResult() self.resourceResult.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.featureData = {} (_ktype133, _vtype134, _size132) = iprot.readMapBegin() for _i136 in range(_size132): _key137 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val138 = Feature() _val138.read(iprot) self.featureData[_key137] = _val138 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ResourceResponse') if self.result is not None: oprot.writeFieldBegin('result', TType.STRUCT, 1) self.result.write(oprot) oprot.writeFieldEnd() if self.resourceResult is not None: oprot.writeFieldBegin('resourceResult', TType.STRUCT, 2) self.resourceResult.write(oprot) oprot.writeFieldEnd() if self.featureData is not None: oprot.writeFieldBegin('featureData', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.featureData)) for kiter139, viter140 in self.featureData.items(): oprot.writeString(kiter139.encode('utf-8') if sys.version_info[0] == 2 else kiter139) viter140.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BizIDResult(object): """ Attributes: - modelStatus - extraInfo - label - score - modelResult """ def __init__(self, modelStatus=None, extraInfo=None, label=None, score=None, modelResult=None,): self.modelStatus = modelStatus self.extraInfo = extraInfo self.label = label self.score = score self.modelResult = modelResult def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.modelStatus = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.extraInfo = [] (_etype144, _size141) = iprot.readListBegin() for _i145 in range(_size141): _elem146 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.extraInfo.append(_elem146) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.label = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.DOUBLE: self.score = iprot.readDouble() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.modelResult = [] (_etype150, _size147) = iprot.readListBegin() for _i151 in range(_size147): _elem152 = ModelResultInfo() _elem152.read(iprot) self.modelResult.append(_elem152) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BizIDResult') if self.modelStatus is not None: oprot.writeFieldBegin('modelStatus', TType.I32, 1) oprot.writeI32(self.modelStatus) oprot.writeFieldEnd() if self.extraInfo is not None: oprot.writeFieldBegin('extraInfo', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.extraInfo)) for iter153 in self.extraInfo: oprot.writeString(iter153.encode('utf-8') if sys.version_info[0] == 2 else iter153) oprot.writeListEnd() oprot.writeFieldEnd() if self.label is not None: oprot.writeFieldBegin('label', TType.STRING, 3) oprot.writeString(self.label.encode('utf-8') if sys.version_info[0] == 2 else self.label) oprot.writeFieldEnd() if self.score is not None: oprot.writeFieldBegin('score', TType.DOUBLE, 4) oprot.writeDouble(self.score) oprot.writeFieldEnd() if self.modelResult is not None: oprot.writeFieldBegin('modelResult', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.modelResult)) for iter154 in self.modelResult: iter154.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.modelStatus is None: raise TProtocolException(message='Required field modelStatus is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BizIDResponse(object): """ Attributes: - result - bizIdResult """ def __init__(self, result=None, bizIdResult=None,): self.result = result self.bizIdResult = bizIdResult def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.result = infra.rpc.base.ttypes.Result() self.result.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.bizIdResult = BizIDResult() self.bizIdResult.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('BizIDResponse') if self.result is not None: oprot.writeFieldBegin('result', TType.STRUCT, 1) self.result.write(oprot) oprot.writeFieldEnd() if self.bizIdResult is not None: oprot.writeFieldBegin('bizIdResult', TType.STRUCT, 2) self.bizIdResult.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(Feature) Feature.thrift_spec = ( None, # 0 (1, TType.I32, 'type', None, None, ), # 1 (2, TType.I32, 'int32Value', None, None, ), # 2 (3, TType.DOUBLE, 'doubleValue', None, None, ), # 3 (4, TType.STRING, 'binaryValue', 'BINARY', None, ), # 4 (5, TType.STRING, 'stringValue', 'UTF8', None, ), # 5 (6, TType.LIST, 'int32ListValue', (TType.I32, None, False), None, ), # 6 (7, TType.LIST, 'doubleListValue', (TType.DOUBLE, None, False), None, ), # 7 (8, TType.LIST, 'binaryListValue', (TType.STRING, 'BINARY', False), None, ), # 8 (9, TType.LIST, 'stringListValue', (TType.STRING, 'UTF8', False), None, ), # 9 (10, TType.MAP, 'stringDoubleMapValue', (TType.STRING, 'UTF8', TType.DOUBLE, None, False), None, ), # 10 (11, TType.LIST, 'double2DList', (TType.LIST, (TType.DOUBLE, None, False), False), None, ), # 11 ) all_structs.append(BizIDRequest) BizIDRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'bizID', 'UTF8', None, ), # 1 (2, TType.STRING, 'serviceType', 'UTF8', None, ), # 2 (3, TType.STRING, 'serviceName', 'UTF8', None, ), # 3 (4, TType.I32, 'sourceType', None, None, ), # 4 (5, TType.I32, 'requestType', None, None, ), # 5 ) all_structs.append(ResourceRequest) ResourceRequest.thrift_spec = ( None, # 0 (1, TType.STRING, 'serviceType', 'UTF8', None, ), # 1 (2, TType.STRING, 'serviceName', 'UTF8', None, ), # 2 (3, TType.I32, 'requestType', None, None, ), # 3 (4, TType.MAP, 'requestData', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.MAP, 'featureData', (TType.STRING, 'UTF8', TType.STRUCT, [Feature, None], False), None, ), # 5 ) all_structs.append(Coordinate) Coordinate.thrift_spec = ( None, # 0 (1, TType.I32, 'x', None, None, ), # 1 (2, TType.I32, 'y', None, None, ), # 2 ) all_structs.append(TextOffset) TextOffset.thrift_spec = ( None, # 0 (1, TType.STRING, 'text', 'UTF8', None, ), # 1 (2, TType.I32, 'offset', None, None, ), # 2 (3, TType.I32, 'length', None, None, ), # 3 ) all_structs.append(AreaInfo) AreaInfo.thrift_spec = ( None, # 0 (1, TType.DOUBLE, 'areaRatio', None, None, ), # 1 (2, TType.I32, 'width', None, None, ), # 2 (3, TType.I32, 'height', None, None, ), # 3 ) all_structs.append(LabelInfo) LabelInfo.thrift_spec = ( None, # 0 (1, TType.I32, 'labelID', None, None, ), # 1 (2, TType.STRING, 'labelName', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 (4, TType.STRING, 'info', 'UTF8', None, ), # 4 (5, TType.I32, 'parrentLabelID', None, None, ), # 5 (6, TType.STRING, 'parrentLabelName', 'UTF8', None, ), # 6 ) all_structs.append(FeatureInfo) FeatureInfo.thrift_spec = ( None, # 0 (1, TType.I32, 'featureID', None, None, ), # 1 (2, TType.STRING, 'featureName', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 (4, TType.STRING, 'info', 'UTF8', None, ), # 4 (5, TType.I32, 'parrentFeatureID', None, None, ), # 5 (6, TType.STRING, 'parrentFeatureName', 'UTF8', None, ), # 6 ) all_structs.append(DetectInfo) DetectInfo.thrift_spec = ( None, # 0 (1, TType.I32, 'instanceIndex', None, None, ), # 1 (2, TType.DOUBLE, 'score', None, None, ), # 2 (3, TType.LIST, 'coordinates', (TType.STRUCT, [Coordinate, None], False), None, ), # 3 (4, TType.LIST, 'labelInfos', (TType.STRUCT, [LabelInfo, None], False), None, ), # 4 (5, TType.STRING, 'instanceName', 'UTF8', None, ), # 5 (6, TType.STRUCT, 'areaInfo', [AreaInfo, None], None, ), # 6 (7, TType.STRUCT, 'textOffset', [TextOffset, None], None, ), # 7 ) all_structs.append(LabelResponse) LabelResponse.thrift_spec = ( None, # 0 (1, TType.I32, 'status', None, None, ), # 1 (2, TType.LIST, 'labelInfos', (TType.STRUCT, [LabelInfo, None], False), None, ), # 2 (3, TType.LIST, 'featureInfos', (TType.STRUCT, [FeatureInfo, None], False), None, ), # 3 ) all_structs.append(DetectResponse) DetectResponse.thrift_spec = ( None, # 0 (1, TType.I32, 'status', None, None, ), # 1 (2, TType.LIST, 'detectInfos', (TType.STRUCT, [DetectInfo, None], False), None, ), # 2 ) all_structs.append(EmbeddingInfo) EmbeddingInfo.thrift_spec = ( None, # 0 (1, TType.LIST, 'shape', (TType.I32, None, False), None, ), # 1 (2, TType.LIST, 'embedding', (TType.DOUBLE, None, False), None, ), # 2 ) all_structs.append(EmbeddingResponse) EmbeddingResponse.thrift_spec = ( None, # 0 (1, TType.I32, 'status', None, None, ), # 1 (2, TType.LIST, 'embeddingInfos', (TType.STRUCT, [EmbeddingInfo, None], False), None, ), # 2 ) all_structs.append(ModelResultInfo) ModelResultInfo.thrift_spec = ( None, # 0 (1, TType.STRING, 'sourceType', 'UTF8', None, ), # 1 (2, TType.STRING, 'label', 'UTF8', None, ), # 2 (3, TType.DOUBLE, 'score', None, None, ), # 3 (4, TType.STRUCT, 'labelResponse', [LabelResponse, None], None, ), # 4 (5, TType.STRUCT, 'detectResponse', [DetectResponse, None], None, ), # 5 (6, TType.STRUCT, 'embeddingResponse', [EmbeddingResponse, None], None, ), # 6 ) all_structs.append(ResourceResult) ResourceResult.thrift_spec = ( None, # 0 (1, TType.I32, 'modelStatus', None, None, ), # 1 (2, TType.LIST, 'extraInfo', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.STRUCT, 'modelResult', [ModelResultInfo, None], None, ), # 3 ) all_structs.append(ResourceResponse) ResourceResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'result', [infra.rpc.base.ttypes.Result, None], None, ), # 1 (2, TType.STRUCT, 'resourceResult', [ResourceResult, None], None, ), # 2 (3, TType.MAP, 'featureData', (TType.STRING, 'UTF8', TType.STRUCT, [Feature, None], False), None, ), # 3 ) all_structs.append(BizIDResult) BizIDResult.thrift_spec = ( None, # 0 (1, TType.I32, 'modelStatus', None, None, ), # 1 (2, TType.LIST, 'extraInfo', (TType.STRING, 'UTF8', False), None, ), # 2 (3, TType.STRING, 'label', 'UTF8', None, ), # 3 (4, TType.DOUBLE, 'score', None, None, ), # 4 (5, TType.LIST, 'modelResult', (TType.STRUCT, [ModelResultInfo, None], False), None, ), # 5 ) all_structs.append(BizIDResponse) BizIDResponse.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'result', [infra.rpc.base.ttypes.Result, None], None, ), # 1 (2, TType.STRUCT, 'bizIdResult', [BizIDResult, None], None, ), # 2 ) fix_spec(all_structs) del all_structs ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/aimedia/__init__.py ===== ===== /workspace/red_serving_py_plugins/MediaIDL/python/MediaIDL/__init__.py =====