<s> from thrift . Thrift import * <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 CrawlUri ( object ) : <EOL> """<STR_LIT>""" <EOL> thrift_spec = ( <EOL> None , <EOL> ( <NUM_LIT:1> , TType . STRING , '<STR_LIT:url>' , None , None , ) , <EOL> ( <NUM_LIT:2> , TType . STRING , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:3> , TType . I16 , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:4> , TType . I64 , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:5> , TType . I64 , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:6> , TType . MAP , '<STR_LIT>' , ( TType . STRING , None , TType . STRING , None ) , None , ) , <EOL> ( <NUM_LIT:7> , TType . MAP , '<STR_LIT>' , ( TType . STRING , None , TType . STRING , None ) , None , ) , <EOL> ( <NUM_LIT:8> , TType . STRING , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:9> , TType . I16 , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:10> , TType . DOUBLE , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:11> , TType . DOUBLE , '<STR_LIT>' , None , None , ) , <EOL> ( <NUM_LIT:12> , TType . MAP , '<STR_LIT>' , ( TType . STRING , None , TType . STRING , None ) , None , ) , <EOL> ) <EOL> def __init__ ( self , url = None , effective_url = None , current_priority = None , begin_processing = None , end_processing = None , req_header = None , rep_header = None , content_body = None , status_code = None , req_time = None , queue_time = None , optional_vars = None , ) : <EOL> self . url = url <EOL> self . effective_url = effective_url <EOL> self . current_priority = current_priority <EOL> self . begin_processing = begin_processing <EOL> self . end_processing = end_processing <EOL> self . req_header = req_header <EOL> self . rep_header = rep_header <EOL> self . content_body = content_body <EOL> self . status_code = status_code <EOL> self . req_time = req_time <EOL> self . queue_time = queue_time <EOL> self . optional_vars = optional_vars <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 . STRING : <EOL> self . url = iprot . readString ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:2> : <EOL> if ftype == TType . STRING : <EOL> self . effective_url = iprot . readString ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:3> : <EOL> if ftype == TType . I16 : <EOL> self . current_priority = iprot . readI16 ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:4> : <EOL> if ftype == TType . I64 : <EOL> self . begin_processing = iprot . readI64 ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:5> : <EOL> if ftype == TType . I64 : <EOL> self . end_processing = iprot . readI64 ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:6> : <EOL> if ftype == TType . MAP : <EOL> self . req_header = { } <EOL> ( _ktype1 , _vtype2 , _size0 ) = iprot . readMapBegin ( ) <EOL> for _i4 in xrange ( _size0 ) : <EOL> _key5 = iprot . readString ( ) ; <EOL> _val6 = iprot . readString ( ) ; <EOL> self . req_header [ _key5 ] = _val6 <EOL> iprot . readMapEnd ( ) <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:7> : <EOL> if ftype == TType . MAP : <EOL> self . rep_header = { } <EOL> ( _ktype8 , _vtype9 , _size7 ) = iprot . readMapBegin ( ) <EOL> for _i11 in xrange ( _size7 ) : <EOL> _key12 = iprot . readString ( ) ; <EOL> _val13 = iprot . readString ( ) ; <EOL> self . rep_header [ _key12 ] = _val13 <EOL> iprot . readMapEnd ( ) <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:8> : <EOL> if ftype == TType . STRING : <EOL> self . content_body = iprot . readString ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:9> : <EOL> if ftype == TType . I16 : <EOL> self . status_code = iprot . readI16 ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:10> : <EOL> if ftype == TType . DOUBLE : <EOL> self . req_time = iprot . readDouble ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:11> : <EOL> if ftype == TType . DOUBLE : <EOL> self . queue_time = iprot . readDouble ( ) ; <EOL> else : <EOL> iprot . skip ( ftype ) <EOL> elif fid == <NUM_LIT:12> : <EOL> if ftype == TType . MAP : <EOL> self . optional_vars = { } <EOL> ( _ktype15 , _vtype16 , _size14 ) = iprot . readMapBegin ( ) <EOL> for _i18 in xrange ( _size14 ) : <EOL> _key19 = iprot . readString ( ) ; <EOL> _val20 = iprot . readString ( ) ; <EOL> self . optional_vars [ _key19 ] = _val20 <EOL> iprot . readMapEnd ( ) <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 . url != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT:url>' , TType . STRING , <NUM_LIT:1> ) <EOL> oprot . writeString ( self . url ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . effective_url != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . STRING , <NUM_LIT:2> ) <EOL> oprot . writeString ( self . effective_url ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . current_priority != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . I16 , <NUM_LIT:3> ) <EOL> oprot . writeI16 ( self . current_priority ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . begin_processing != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . I64 , <NUM_LIT:4> ) <EOL> oprot . writeI64 ( self . begin_processing ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . end_processing != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . I64 , <NUM_LIT:5> ) <EOL> oprot . writeI64 ( self . end_processing ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . req_header != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . MAP , <NUM_LIT:6> ) <EOL> oprot . writeMapBegin ( TType . STRING , TType . STRING , len ( self . req_header ) ) <EOL> for kiter21 , viter22 in self . req_header . items ( ) : <EOL> oprot . writeString ( kiter21 ) <EOL> oprot . writeString ( viter22 ) <EOL> oprot . writeMapEnd ( ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . rep_header != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . MAP , <NUM_LIT:7> ) <EOL> oprot . writeMapBegin ( TType . STRING , TType . STRING , len ( self . rep_header ) ) <EOL> for kiter23 , viter24 in self . rep_header . items ( ) : <EOL> oprot . writeString ( kiter23 ) <EOL> oprot . writeString ( viter24 ) <EOL> oprot . writeMapEnd ( ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . content_body != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . STRING , <NUM_LIT:8> ) <EOL> oprot . writeString ( self . content_body ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . status_code != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . I16 , <NUM_LIT:9> ) <EOL> oprot . writeI16 ( self . status_code ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . req_time != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . DOUBLE , <NUM_LIT:10> ) <EOL> oprot . writeDouble ( self . req_time ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . queue_time != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . DOUBLE , <NUM_LIT:11> ) <EOL> oprot . writeDouble ( self . queue_time ) <EOL> oprot . writeFieldEnd ( ) <EOL> if self . optional_vars != None : <EOL> oprot . writeFieldBegin ( '<STR_LIT>' , TType . MAP , <NUM_LIT:12> ) <EOL> oprot . writeMapBegin ( TType . STRING , TType . STRING , len ( self . optional_vars ) ) <EOL> for kiter25 , viter26 in self . optional_vars . items ( ) : <EOL> oprot . writeString ( kiter25 ) <EOL> oprot . writeString ( viter26 ) <EOL> oprot . writeMapEnd ( ) <EOL> oprot . writeFieldEnd ( ) <EOL> oprot . writeFieldStop ( ) <EOL> oprot . writeStructEnd ( ) <EOL> def validate ( self ) : <EOL> return <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>
