<s> from thrift . Thrift import * <EOL> from thrift . protocol import TBinaryProtocol <EOL> from thrift . transport import TTransport <EOL> try : <EOL> from thrift . protocol import fastbinary <EOL> except : <EOL> fastbinary = None <EOL> class TBase ( object ) : <EOL> __slots__ = [ ] <EOL> def __repr__ ( self ) : <EOL> L = [ '<STR_LIT>' % ( key , getattr ( self , key ) ) <EOL> for key in self . __slots__ ] <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , '<STR_LIT:U+002CU+0020>' . join ( L ) ) <EOL> def __eq__ ( self , other ) : <EOL> if not isinstance ( other , self . __class__ ) : <EOL> return False <EOL> for attr in self . __slots__ : <EOL> my_val = getattr ( self , attr ) <EOL> other_val = getattr ( other , attr ) <EOL> if my_val != other_val : <EOL> return False <EOL> return True <EOL> def __ne__ ( self , other ) : <EOL> return not ( self == other ) <EOL> def read ( self , iprot ) : <EOL> if ( iprot . __class__ == TBinaryProtocol . TBinaryProtocolAccelerated and <EOL> isinstance ( iprot . trans , TTransport . CReadableTransport ) and <EOL> self . thrift_spec is not None and <EOL> fastbinary is not None ) : <EOL> fastbinary . decode_binary ( self , <EOL> iprot . trans , <EOL> ( self . __class__ , self . thrift_spec ) ) <EOL> return <EOL> iprot . readStruct ( self , self . thrift_spec ) <EOL> def write ( self , oprot ) : <EOL> if ( oprot . __class__ == TBinaryProtocol . TBinaryProtocolAccelerated and <EOL> self . thrift_spec is not None and <EOL> fastbinary is not None ) : <EOL> oprot . trans . write ( <EOL> fastbinary . encode_binary ( self , ( self . __class__ , self . thrift_spec ) ) ) <EOL> return <EOL> oprot . writeStruct ( self , self . thrift_spec ) <EOL> class TExceptionBase ( Exception ) : <EOL> __slots__ = [ ] <EOL> __repr__ = TBase . __repr__ . im_func <EOL> __eq__ = TBase . __eq__ . im_func <EOL> __ne__ = TBase . __ne__ . im_func <EOL> read = TBase . read . im_func <EOL> write = TBase . write . im_func </s>
