<s> from thrift . Thrift import TType , TMessageType , TException <EOL> from thrift . transport import TTransport <EOL> from thrift . protocol import TBinaryProtocol , TProtocol <EOL> try : <EOL> from thrift . protocol import fastbinary <EOL> except : <EOL> fastbinary = None <EOL> class RetriableRPCException ( TException ) : <EOL> """<STR_LIT>""" <EOL> thrift_spec = ( <EOL> None , <EOL> ( <NUM_LIT:1> , TType . I32 , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:2> , TType . STRING , '<STR_LIT:message>' , None , None , ) , <EOL> ) <EOL> def __init__ ( self , errorCode = None , message = None , ) : <EOL> self . errorCode = errorCode <EOL> self . message = message <EOL> def read ( self , iprot ) : <EOL> if iprot . __class__ == TBinaryProtocol . TBinaryProtocolAccelerated and isinstance ( iprot . trans , TTransport . CReadableTransport ) and self . thrift_spec is not None and fastbinary is not None : <EOL> fastbinary . decode_binary ( self , iprot . trans , ( self . __class__ , self . thrift_spec ) ) <EOL> return <EOL> iprot . readStructBegin ( ) <EOL> while True : <EOL> ( fname , ftype , fid ) = iprot . readFieldBegin ( ) <EOL> if ftype == TType . STOP : <EOL> break <EOL> if fid == <NUM_LIT:1> : <EOL> if ftype == TType . I32 : <EOL> self . errorCode = iprot . readI32 ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:2> : <EOL> if ftype == TType . STRING : <EOL> self . message = iprot . readString ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> iprot . readFieldEnd ( ) <EOL> iprot . readStructEnd ( ) <EOL> def write ( self , oprot ) : <EOL> if oprot . __class__ == TBinaryProtocol . TBinaryProtocolAccelerated and self . thrift_spec is not None and fastbinary is not None : <EOL> oprot . trans . write ( fastbinary . encode_binary ( self , ( self . __class__ , self . thrift_spec ) ) ) <EOL> return <EOL> oprot . writeStructBegin ( '<STR_LIT>' ) <EOL> if self . errorCode is not None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . I32 , <NUM_LIT:1> ) <EOL> oprot . writeI32 ( self . errorCode ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . message is not None : <EOL> oprot . writeFieldBegin ( '<STR_LIT:message>' , TType . STRING , <NUM_LIT:2> ) <EOL> oprot . writeString ( self . message ) <EOL> oprot . writeFieldEnd ( ) <EOL> oprot . writeFieldStop ( ) <EOL> oprot . writeStructEnd ( ) <EOL> def validate ( self ) : <EOL> return <EOL> def __str__ ( self ) : <EOL> return repr ( self ) <EOL> def __repr__ ( self ) : <EOL> L = [ '<STR_LIT>' % ( key , value ) <EOL> for key , value in self . __dict__ . iteritems ( ) ] <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , '<STR_LIT:U+002CU+0020>' . join ( L ) ) <EOL> def __eq__ ( self , other ) : <EOL> return isinstance ( other , self . __class__ ) and self . __dict__ == other . __dict__ <EOL> def __ne__ ( self , other ) : <EOL> return not ( self == other ) </s>
