<s> from google . net . proto import ProtocolBuffer <EOL> import array <EOL> import dummy_thread as thread <EOL> __pychecker__ = """<STR_LIT>""" <EOL> if hasattr ( ProtocolBuffer , '<STR_LIT>' ) : <EOL> _extension_runtime = True <EOL> _ExtendableProtocolMessage = ProtocolBuffer . ExtendableProtocolMessage <EOL> else : <EOL> _extension_runtime = False <EOL> _ExtendableProtocolMessage = ProtocolBuffer . ProtocolMessage <EOL> class ConversionServiceError ( ProtocolBuffer . ProtocolMessage ) : <EOL> OK = <NUM_LIT:0> <EOL> TIMEOUT = <NUM_LIT:1> <EOL> TRANSIENT_ERROR = <NUM_LIT:2> <EOL> INTERNAL_ERROR = <NUM_LIT:3> <EOL> UNSUPPORTED_CONVERSION = <NUM_LIT:4> <EOL> CONVERSION_TOO_LARGE = <NUM_LIT:5> <EOL> TOO_MANY_CONVERSIONS = <NUM_LIT:6> <EOL> INVALID_REQUEST = <NUM_LIT:7> <EOL> _ErrorCode_NAMES = { <EOL> <NUM_LIT:0> : "<STR_LIT:OK>" , <EOL> <NUM_LIT:1> : "<STR_LIT>" , <EOL> <NUM_LIT:2> : "<STR_LIT>" , <EOL> <NUM_LIT:3> : "<STR_LIT>" , <EOL> <NUM_LIT:4> : "<STR_LIT>" , <EOL> <NUM_LIT:5> : "<STR_LIT>" , <EOL> <NUM_LIT:6> : "<STR_LIT>" , <EOL> <NUM_LIT:7> : "<STR_LIT>" , <EOL> } <EOL> def ErrorCode_Name ( cls , x ) : return cls . _ErrorCode_NAMES . get ( x , "<STR_LIT>" ) <EOL> ErrorCode_Name = classmethod ( ErrorCode_Name ) <EOL> def __init__ ( self , contents = None ) : <EOL> pass <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> return n <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> return n <EOL> def Clear ( self ) : <EOL> pass <EOL> def OutputUnchecked ( self , out ) : <EOL> pass <EOL> def OutputPartial ( self , out ) : <EOL> pass <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> } , <NUM_LIT:0> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> } , <NUM_LIT:0> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class AssetInfo ( ProtocolBuffer . ProtocolMessage ) : <EOL> has_name_ = <NUM_LIT:0> <EOL> name_ = "<STR_LIT>" <EOL> has_data_ = <NUM_LIT:0> <EOL> data_ = "<STR_LIT>" <EOL> has_mime_type_ = <NUM_LIT:0> <EOL> mime_type_ = "<STR_LIT>" <EOL> def __init__ ( self , contents = None ) : <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def name ( self ) : return self . name_ <EOL> def set_name ( self , x ) : <EOL> self . has_name_ = <NUM_LIT:1> <EOL> self . name_ = x <EOL> def clear_name ( self ) : <EOL> if self . has_name_ : <EOL> self . has_name_ = <NUM_LIT:0> <EOL> self . name_ = "<STR_LIT>" <EOL> def has_name ( self ) : return self . has_name_ <EOL> def data ( self ) : return self . data_ <EOL> def set_data ( self , x ) : <EOL> self . has_data_ = <NUM_LIT:1> <EOL> self . data_ = x <EOL> def clear_data ( self ) : <EOL> if self . has_data_ : <EOL> self . has_data_ = <NUM_LIT:0> <EOL> self . data_ = "<STR_LIT>" <EOL> def has_data ( self ) : return self . has_data_ <EOL> def mime_type ( self ) : return self . mime_type_ <EOL> def set_mime_type ( self , x ) : <EOL> self . has_mime_type_ = <NUM_LIT:1> <EOL> self . mime_type_ = x <EOL> def clear_mime_type ( self ) : <EOL> if self . has_mime_type_ : <EOL> self . has_mime_type_ = <NUM_LIT:0> <EOL> self . mime_type_ = "<STR_LIT>" <EOL> def has_mime_type ( self ) : return self . has_mime_type_ <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> if ( x . has_name ( ) ) : self . set_name ( x . name ( ) ) <EOL> if ( x . has_data ( ) ) : self . set_data ( x . data ( ) ) <EOL> if ( x . has_mime_type ( ) ) : self . set_mime_type ( x . mime_type ( ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if self . has_name_ != x . has_name_ : return <NUM_LIT:0> <EOL> if self . has_name_ and self . name_ != x . name_ : return <NUM_LIT:0> <EOL> if self . has_data_ != x . has_data_ : return <NUM_LIT:0> <EOL> if self . has_data_ and self . data_ != x . data_ : return <NUM_LIT:0> <EOL> if self . has_mime_type_ != x . has_mime_type_ : return <NUM_LIT:0> <EOL> if self . has_mime_type_ and self . mime_type_ != x . mime_type_ : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> if ( self . has_name_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . name_ ) ) <EOL> if ( self . has_data_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . data_ ) ) <EOL> if ( self . has_mime_type_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . mime_type_ ) ) <EOL> return n <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> if ( self . has_name_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . name_ ) ) <EOL> if ( self . has_data_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . data_ ) ) <EOL> if ( self . has_mime_type_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . mime_type_ ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_name ( ) <EOL> self . clear_data ( ) <EOL> self . clear_mime_type ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> if ( self . has_name_ ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putPrefixedString ( self . name_ ) <EOL> if ( self . has_data_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . data_ ) <EOL> if ( self . has_mime_type_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . mime_type_ ) <EOL> def OutputPartial ( self , out ) : <EOL> if ( self . has_name_ ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putPrefixedString ( self . name_ ) <EOL> if ( self . has_data_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . data_ ) <EOL> if ( self . has_mime_type_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . mime_type_ ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> self . set_name ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> self . set_data ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> self . set_mime_type ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> if self . has_name_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . name_ ) ) <EOL> if self . has_data_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . data_ ) ) <EOL> if self . has_mime_type_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . mime_type_ ) ) <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kname = <NUM_LIT:1> <EOL> kdata = <NUM_LIT:2> <EOL> kmime_type = <NUM_LIT:3> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT:name>" , <EOL> <NUM_LIT:2> : "<STR_LIT:data>" , <EOL> <NUM_LIT:3> : "<STR_LIT>" , <EOL> } , <NUM_LIT:3> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> <NUM_LIT:2> : ProtocolBuffer . Encoder . STRING , <EOL> <NUM_LIT:3> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:3> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class DocumentInfo ( ProtocolBuffer . ProtocolMessage ) : <EOL> def __init__ ( self , contents = None ) : <EOL> self . asset_ = [ ] <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def asset_size ( self ) : return len ( self . asset_ ) <EOL> def asset_list ( self ) : return self . asset_ <EOL> def asset ( self , i ) : <EOL> return self . asset_ [ i ] <EOL> def mutable_asset ( self , i ) : <EOL> return self . asset_ [ i ] <EOL> def add_asset ( self ) : <EOL> x = AssetInfo ( ) <EOL> self . asset_ . append ( x ) <EOL> return x <EOL> def clear_asset ( self ) : <EOL> self . asset_ = [ ] <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> for i in xrange ( x . asset_size ( ) ) : self . add_asset ( ) . CopyFrom ( x . asset ( i ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if len ( self . asset_ ) != len ( x . asset_ ) : return <NUM_LIT:0> <EOL> for e1 , e2 in zip ( self . asset_ , x . asset_ ) : <EOL> if e1 != e2 : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> for p in self . asset_ : <EOL> if not p . IsInitialized ( debug_strs ) : initialized = <NUM_LIT:0> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . asset_ ) <EOL> for i in xrange ( len ( self . asset_ ) ) : n += self . lengthString ( self . asset_ [ i ] . ByteSize ( ) ) <EOL> return n <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . asset_ ) <EOL> for i in xrange ( len ( self . asset_ ) ) : n += self . lengthString ( self . asset_ [ i ] . ByteSizePartial ( ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_asset ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> for i in xrange ( len ( self . asset_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . asset_ [ i ] . ByteSize ( ) ) <EOL> self . asset_ [ i ] . OutputUnchecked ( out ) <EOL> def OutputPartial ( self , out ) : <EOL> for i in xrange ( len ( self . asset_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . asset_ [ i ] . ByteSizePartial ( ) ) <EOL> self . asset_ [ i ] . OutputPartial ( out ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . add_asset ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> cnt = <NUM_LIT:0> <EOL> for e in self . asset_ : <EOL> elm = "<STR_LIT>" <EOL> if printElemNumber : elm = "<STR_LIT>" % cnt <EOL> res += prefix + ( "<STR_LIT>" % elm ) <EOL> res += e . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> cnt += <NUM_LIT:1> <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kasset = <NUM_LIT:1> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT>" , <EOL> } , <NUM_LIT:1> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:1> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class ConversionInput_AuxData ( ProtocolBuffer . ProtocolMessage ) : <EOL> has_key_ = <NUM_LIT:0> <EOL> key_ = "<STR_LIT>" <EOL> has_value_ = <NUM_LIT:0> <EOL> value_ = "<STR_LIT>" <EOL> def __init__ ( self , contents = None ) : <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def key ( self ) : return self . key_ <EOL> def set_key ( self , x ) : <EOL> self . has_key_ = <NUM_LIT:1> <EOL> self . key_ = x <EOL> def clear_key ( self ) : <EOL> if self . has_key_ : <EOL> self . has_key_ = <NUM_LIT:0> <EOL> self . key_ = "<STR_LIT>" <EOL> def has_key ( self ) : return self . has_key_ <EOL> def value ( self ) : return self . value_ <EOL> def set_value ( self , x ) : <EOL> self . has_value_ = <NUM_LIT:1> <EOL> self . value_ = x <EOL> def clear_value ( self ) : <EOL> if self . has_value_ : <EOL> self . has_value_ = <NUM_LIT:0> <EOL> self . value_ = "<STR_LIT>" <EOL> def has_value ( self ) : return self . has_value_ <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> if ( x . has_key ( ) ) : self . set_key ( x . key ( ) ) <EOL> if ( x . has_value ( ) ) : self . set_value ( x . value ( ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if self . has_key_ != x . has_key_ : return <NUM_LIT:0> <EOL> if self . has_key_ and self . key_ != x . key_ : return <NUM_LIT:0> <EOL> if self . has_value_ != x . has_value_ : return <NUM_LIT:0> <EOL> if self . has_value_ and self . value_ != x . value_ : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> if ( not self . has_key_ ) : <EOL> initialized = <NUM_LIT:0> <EOL> if debug_strs is not None : <EOL> debug_strs . append ( '<STR_LIT>' ) <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += self . lengthString ( len ( self . key_ ) ) <EOL> if ( self . has_value_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . value_ ) ) <EOL> return n + <NUM_LIT:1> <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> if ( self . has_key_ ) : <EOL> n += <NUM_LIT:1> <EOL> n += self . lengthString ( len ( self . key_ ) ) <EOL> if ( self . has_value_ ) : n += <NUM_LIT:1> + self . lengthString ( len ( self . value_ ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_key ( ) <EOL> self . clear_value ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putPrefixedString ( self . key_ ) <EOL> if ( self . has_value_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . value_ ) <EOL> def OutputPartial ( self , out ) : <EOL> if ( self . has_key_ ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putPrefixedString ( self . key_ ) <EOL> if ( self . has_value_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . value_ ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> self . set_key ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> self . set_value ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> if self . has_key_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . key_ ) ) <EOL> if self . has_value_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . value_ ) ) <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kkey = <NUM_LIT:1> <EOL> kvalue = <NUM_LIT:2> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT:key>" , <EOL> <NUM_LIT:2> : "<STR_LIT:value>" , <EOL> } , <NUM_LIT:2> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> <NUM_LIT:2> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:2> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class ConversionInput ( ProtocolBuffer . ProtocolMessage ) : <EOL> has_input_ = <NUM_LIT:0> <EOL> has_output_mime_type_ = <NUM_LIT:0> <EOL> output_mime_type_ = "<STR_LIT>" <EOL> def __init__ ( self , contents = None ) : <EOL> self . input_ = DocumentInfo ( ) <EOL> self . flag_ = [ ] <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def input ( self ) : return self . input_ <EOL> def mutable_input ( self ) : self . has_input_ = <NUM_LIT:1> ; return self . input_ <EOL> def clear_input ( self ) : self . has_input_ = <NUM_LIT:0> ; self . input_ . Clear ( ) <EOL> def has_input ( self ) : return self . has_input_ <EOL> def output_mime_type ( self ) : return self . output_mime_type_ <EOL> def set_output_mime_type ( self , x ) : <EOL> self . has_output_mime_type_ = <NUM_LIT:1> <EOL> self . output_mime_type_ = x <EOL> def clear_output_mime_type ( self ) : <EOL> if self . has_output_mime_type_ : <EOL> self . has_output_mime_type_ = <NUM_LIT:0> <EOL> self . output_mime_type_ = "<STR_LIT>" <EOL> def has_output_mime_type ( self ) : return self . has_output_mime_type_ <EOL> def flag_size ( self ) : return len ( self . flag_ ) <EOL> def flag_list ( self ) : return self . flag_ <EOL> def flag ( self , i ) : <EOL> return self . flag_ [ i ] <EOL> def mutable_flag ( self , i ) : <EOL> return self . flag_ [ i ] <EOL> def add_flag ( self ) : <EOL> x = ConversionInput_AuxData ( ) <EOL> self . flag_ . append ( x ) <EOL> return x <EOL> def clear_flag ( self ) : <EOL> self . flag_ = [ ] <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> if ( x . has_input ( ) ) : self . mutable_input ( ) . MergeFrom ( x . input ( ) ) <EOL> if ( x . has_output_mime_type ( ) ) : self . set_output_mime_type ( x . output_mime_type ( ) ) <EOL> for i in xrange ( x . flag_size ( ) ) : self . add_flag ( ) . CopyFrom ( x . flag ( i ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if self . has_input_ != x . has_input_ : return <NUM_LIT:0> <EOL> if self . has_input_ and self . input_ != x . input_ : return <NUM_LIT:0> <EOL> if self . has_output_mime_type_ != x . has_output_mime_type_ : return <NUM_LIT:0> <EOL> if self . has_output_mime_type_ and self . output_mime_type_ != x . output_mime_type_ : return <NUM_LIT:0> <EOL> if len ( self . flag_ ) != len ( x . flag_ ) : return <NUM_LIT:0> <EOL> for e1 , e2 in zip ( self . flag_ , x . flag_ ) : <EOL> if e1 != e2 : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> if ( not self . has_input_ ) : <EOL> initialized = <NUM_LIT:0> <EOL> if debug_strs is not None : <EOL> debug_strs . append ( '<STR_LIT>' ) <EOL> elif not self . input_ . IsInitialized ( debug_strs ) : initialized = <NUM_LIT:0> <EOL> if ( not self . has_output_mime_type_ ) : <EOL> initialized = <NUM_LIT:0> <EOL> if debug_strs is not None : <EOL> debug_strs . append ( '<STR_LIT>' ) <EOL> for p in self . flag_ : <EOL> if not p . IsInitialized ( debug_strs ) : initialized = <NUM_LIT:0> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += self . lengthString ( self . input_ . ByteSize ( ) ) <EOL> n += self . lengthString ( len ( self . output_mime_type_ ) ) <EOL> n += <NUM_LIT:1> * len ( self . flag_ ) <EOL> for i in xrange ( len ( self . flag_ ) ) : n += self . lengthString ( self . flag_ [ i ] . ByteSize ( ) ) <EOL> return n + <NUM_LIT:2> <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> if ( self . has_input_ ) : <EOL> n += <NUM_LIT:1> <EOL> n += self . lengthString ( self . input_ . ByteSizePartial ( ) ) <EOL> if ( self . has_output_mime_type_ ) : <EOL> n += <NUM_LIT:1> <EOL> n += self . lengthString ( len ( self . output_mime_type_ ) ) <EOL> n += <NUM_LIT:1> * len ( self . flag_ ) <EOL> for i in xrange ( len ( self . flag_ ) ) : n += self . lengthString ( self . flag_ [ i ] . ByteSizePartial ( ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_input ( ) <EOL> self . clear_output_mime_type ( ) <EOL> self . clear_flag ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . input_ . ByteSize ( ) ) <EOL> self . input_ . OutputUnchecked ( out ) <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . output_mime_type_ ) <EOL> for i in xrange ( len ( self . flag_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putVarInt32 ( self . flag_ [ i ] . ByteSize ( ) ) <EOL> self . flag_ [ i ] . OutputUnchecked ( out ) <EOL> def OutputPartial ( self , out ) : <EOL> if ( self . has_input_ ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . input_ . ByteSizePartial ( ) ) <EOL> self . input_ . OutputPartial ( out ) <EOL> if ( self . has_output_mime_type_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putPrefixedString ( self . output_mime_type_ ) <EOL> for i in xrange ( len ( self . flag_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putVarInt32 ( self . flag_ [ i ] . ByteSizePartial ( ) ) <EOL> self . flag_ [ i ] . OutputPartial ( out ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . mutable_input ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> self . set_output_mime_type ( d . getPrefixedString ( ) ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . add_flag ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> if self . has_input_ : <EOL> res += prefix + "<STR_LIT>" <EOL> res += self . input_ . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> if self . has_output_mime_type_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatString ( self . output_mime_type_ ) ) <EOL> cnt = <NUM_LIT:0> <EOL> for e in self . flag_ : <EOL> elm = "<STR_LIT>" <EOL> if printElemNumber : elm = "<STR_LIT>" % cnt <EOL> res += prefix + ( "<STR_LIT>" % elm ) <EOL> res += e . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> cnt += <NUM_LIT:1> <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kinput = <NUM_LIT:1> <EOL> koutput_mime_type = <NUM_LIT:2> <EOL> kflag = <NUM_LIT:3> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT:input>" , <EOL> <NUM_LIT:2> : "<STR_LIT>" , <EOL> <NUM_LIT:3> : "<STR_LIT>" , <EOL> } , <NUM_LIT:3> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> <NUM_LIT:2> : ProtocolBuffer . Encoder . STRING , <EOL> <NUM_LIT:3> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:3> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class ConversionOutput ( ProtocolBuffer . ProtocolMessage ) : <EOL> has_error_code_ = <NUM_LIT:0> <EOL> error_code_ = <NUM_LIT:0> <EOL> has_output_ = <NUM_LIT:0> <EOL> output_ = None <EOL> def __init__ ( self , contents = None ) : <EOL> self . lazy_init_lock_ = thread . allocate_lock ( ) <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def error_code ( self ) : return self . error_code_ <EOL> def set_error_code ( self , x ) : <EOL> self . has_error_code_ = <NUM_LIT:1> <EOL> self . error_code_ = x <EOL> def clear_error_code ( self ) : <EOL> if self . has_error_code_ : <EOL> self . has_error_code_ = <NUM_LIT:0> <EOL> self . error_code_ = <NUM_LIT:0> <EOL> def has_error_code ( self ) : return self . has_error_code_ <EOL> def output ( self ) : <EOL> if self . output_ is None : <EOL> self . lazy_init_lock_ . acquire ( ) <EOL> try : <EOL> if self . output_ is None : self . output_ = DocumentInfo ( ) <EOL> finally : <EOL> self . lazy_init_lock_ . release ( ) <EOL> return self . output_ <EOL> def mutable_output ( self ) : self . has_output_ = <NUM_LIT:1> ; return self . output ( ) <EOL> def clear_output ( self ) : <EOL> if self . has_output_ : <EOL> self . has_output_ = <NUM_LIT:0> ; <EOL> if self . output_ is not None : self . output_ . Clear ( ) <EOL> def has_output ( self ) : return self . has_output_ <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> if ( x . has_error_code ( ) ) : self . set_error_code ( x . error_code ( ) ) <EOL> if ( x . has_output ( ) ) : self . mutable_output ( ) . MergeFrom ( x . output ( ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if self . has_error_code_ != x . has_error_code_ : return <NUM_LIT:0> <EOL> if self . has_error_code_ and self . error_code_ != x . error_code_ : return <NUM_LIT:0> <EOL> if self . has_output_ != x . has_output_ : return <NUM_LIT:0> <EOL> if self . has_output_ and self . output_ != x . output_ : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> if ( not self . has_error_code_ ) : <EOL> initialized = <NUM_LIT:0> <EOL> if debug_strs is not None : <EOL> debug_strs . append ( '<STR_LIT>' ) <EOL> if ( self . has_output_ and not self . output_ . IsInitialized ( debug_strs ) ) : initialized = <NUM_LIT:0> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += self . lengthVarInt64 ( self . error_code_ ) <EOL> if ( self . has_output_ ) : n += <NUM_LIT:1> + self . lengthString ( self . output_ . ByteSize ( ) ) <EOL> return n + <NUM_LIT:1> <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> if ( self . has_error_code_ ) : <EOL> n += <NUM_LIT:1> <EOL> n += self . lengthVarInt64 ( self . error_code_ ) <EOL> if ( self . has_output_ ) : n += <NUM_LIT:1> + self . lengthString ( self . output_ . ByteSizePartial ( ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_error_code ( ) <EOL> self . clear_output ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> out . putVarInt32 ( <NUM_LIT:8> ) <EOL> out . putVarInt32 ( self . error_code_ ) <EOL> if ( self . has_output_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putVarInt32 ( self . output_ . ByteSize ( ) ) <EOL> self . output_ . OutputUnchecked ( out ) <EOL> def OutputPartial ( self , out ) : <EOL> if ( self . has_error_code_ ) : <EOL> out . putVarInt32 ( <NUM_LIT:8> ) <EOL> out . putVarInt32 ( self . error_code_ ) <EOL> if ( self . has_output_ ) : <EOL> out . putVarInt32 ( <NUM_LIT> ) <EOL> out . putVarInt32 ( self . output_ . ByteSizePartial ( ) ) <EOL> self . output_ . OutputPartial ( out ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:8> : <EOL> self . set_error_code ( d . getVarInt32 ( ) ) <EOL> continue <EOL> if tt == <NUM_LIT> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . mutable_output ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> if self . has_error_code_ : res += prefix + ( "<STR_LIT>" % self . DebugFormatInt32 ( self . error_code_ ) ) <EOL> if self . has_output_ : <EOL> res += prefix + "<STR_LIT>" <EOL> res += self . output_ . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kerror_code = <NUM_LIT:1> <EOL> koutput = <NUM_LIT:2> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT>" , <EOL> <NUM_LIT:2> : "<STR_LIT>" , <EOL> } , <NUM_LIT:2> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:2> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:2> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class ConversionRequest ( ProtocolBuffer . ProtocolMessage ) : <EOL> def __init__ ( self , contents = None ) : <EOL> self . conversion_ = [ ] <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def conversion_size ( self ) : return len ( self . conversion_ ) <EOL> def conversion_list ( self ) : return self . conversion_ <EOL> def conversion ( self , i ) : <EOL> return self . conversion_ [ i ] <EOL> def mutable_conversion ( self , i ) : <EOL> return self . conversion_ [ i ] <EOL> def add_conversion ( self ) : <EOL> x = ConversionInput ( ) <EOL> self . conversion_ . append ( x ) <EOL> return x <EOL> def clear_conversion ( self ) : <EOL> self . conversion_ = [ ] <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> for i in xrange ( x . conversion_size ( ) ) : self . add_conversion ( ) . CopyFrom ( x . conversion ( i ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if len ( self . conversion_ ) != len ( x . conversion_ ) : return <NUM_LIT:0> <EOL> for e1 , e2 in zip ( self . conversion_ , x . conversion_ ) : <EOL> if e1 != e2 : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> for p in self . conversion_ : <EOL> if not p . IsInitialized ( debug_strs ) : initialized = <NUM_LIT:0> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . conversion_ ) <EOL> for i in xrange ( len ( self . conversion_ ) ) : n += self . lengthString ( self . conversion_ [ i ] . ByteSize ( ) ) <EOL> return n <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . conversion_ ) <EOL> for i in xrange ( len ( self . conversion_ ) ) : n += self . lengthString ( self . conversion_ [ i ] . ByteSizePartial ( ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_conversion ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> for i in xrange ( len ( self . conversion_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . conversion_ [ i ] . ByteSize ( ) ) <EOL> self . conversion_ [ i ] . OutputUnchecked ( out ) <EOL> def OutputPartial ( self , out ) : <EOL> for i in xrange ( len ( self . conversion_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . conversion_ [ i ] . ByteSizePartial ( ) ) <EOL> self . conversion_ [ i ] . OutputPartial ( out ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . add_conversion ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> cnt = <NUM_LIT:0> <EOL> for e in self . conversion_ : <EOL> elm = "<STR_LIT>" <EOL> if printElemNumber : elm = "<STR_LIT>" % cnt <EOL> res += prefix + ( "<STR_LIT>" % elm ) <EOL> res += e . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> cnt += <NUM_LIT:1> <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kconversion = <NUM_LIT:1> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT>" , <EOL> } , <NUM_LIT:1> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:1> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> class ConversionResponse ( ProtocolBuffer . ProtocolMessage ) : <EOL> def __init__ ( self , contents = None ) : <EOL> self . result_ = [ ] <EOL> if contents is not None : self . MergeFromString ( contents ) <EOL> def result_size ( self ) : return len ( self . result_ ) <EOL> def result_list ( self ) : return self . result_ <EOL> def result ( self , i ) : <EOL> return self . result_ [ i ] <EOL> def mutable_result ( self , i ) : <EOL> return self . result_ [ i ] <EOL> def add_result ( self ) : <EOL> x = ConversionOutput ( ) <EOL> self . result_ . append ( x ) <EOL> return x <EOL> def clear_result ( self ) : <EOL> self . result_ = [ ] <EOL> def MergeFrom ( self , x ) : <EOL> assert x is not self <EOL> for i in xrange ( x . result_size ( ) ) : self . add_result ( ) . CopyFrom ( x . result ( i ) ) <EOL> def Equals ( self , x ) : <EOL> if x is self : return <NUM_LIT:1> <EOL> if len ( self . result_ ) != len ( x . result_ ) : return <NUM_LIT:0> <EOL> for e1 , e2 in zip ( self . result_ , x . result_ ) : <EOL> if e1 != e2 : return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> def IsInitialized ( self , debug_strs = None ) : <EOL> initialized = <NUM_LIT:1> <EOL> for p in self . result_ : <EOL> if not p . IsInitialized ( debug_strs ) : initialized = <NUM_LIT:0> <EOL> return initialized <EOL> def ByteSize ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . result_ ) <EOL> for i in xrange ( len ( self . result_ ) ) : n += self . lengthString ( self . result_ [ i ] . ByteSize ( ) ) <EOL> return n <EOL> def ByteSizePartial ( self ) : <EOL> n = <NUM_LIT:0> <EOL> n += <NUM_LIT:1> * len ( self . result_ ) <EOL> for i in xrange ( len ( self . result_ ) ) : n += self . lengthString ( self . result_ [ i ] . ByteSizePartial ( ) ) <EOL> return n <EOL> def Clear ( self ) : <EOL> self . clear_result ( ) <EOL> def OutputUnchecked ( self , out ) : <EOL> for i in xrange ( len ( self . result_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . result_ [ i ] . ByteSize ( ) ) <EOL> self . result_ [ i ] . OutputUnchecked ( out ) <EOL> def OutputPartial ( self , out ) : <EOL> for i in xrange ( len ( self . result_ ) ) : <EOL> out . putVarInt32 ( <NUM_LIT:10> ) <EOL> out . putVarInt32 ( self . result_ [ i ] . ByteSizePartial ( ) ) <EOL> self . result_ [ i ] . OutputPartial ( out ) <EOL> def TryMerge ( self , d ) : <EOL> while d . avail ( ) > <NUM_LIT:0> : <EOL> tt = d . getVarInt32 ( ) <EOL> if tt == <NUM_LIT:10> : <EOL> length = d . getVarInt32 ( ) <EOL> tmp = ProtocolBuffer . Decoder ( d . buffer ( ) , d . pos ( ) , d . pos ( ) + length ) <EOL> d . skip ( length ) <EOL> self . add_result ( ) . TryMerge ( tmp ) <EOL> continue <EOL> if ( tt == <NUM_LIT:0> ) : raise ProtocolBuffer . ProtocolBufferDecodeError <EOL> d . skipData ( tt ) <EOL> def __str__ ( self , prefix = "<STR_LIT>" , printElemNumber = <NUM_LIT:0> ) : <EOL> res = "<STR_LIT>" <EOL> cnt = <NUM_LIT:0> <EOL> for e in self . result_ : <EOL> elm = "<STR_LIT>" <EOL> if printElemNumber : elm = "<STR_LIT>" % cnt <EOL> res += prefix + ( "<STR_LIT>" % elm ) <EOL> res += e . __str__ ( prefix + "<STR_LIT:U+0020>" , printElemNumber ) <EOL> res += prefix + "<STR_LIT>" <EOL> cnt += <NUM_LIT:1> <EOL> return res <EOL> def _BuildTagLookupTable ( sparse , maxtag , default = None ) : <EOL> return tuple ( [ sparse . get ( i , default ) for i in xrange ( <NUM_LIT:0> , <NUM_LIT:1> + maxtag ) ] ) <EOL> kresult = <NUM_LIT:1> <EOL> _TEXT = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:1> : "<STR_LIT:result>" , <EOL> } , <NUM_LIT:1> ) <EOL> _TYPES = _BuildTagLookupTable ( { <EOL> <NUM_LIT:0> : ProtocolBuffer . Encoder . NUMERIC , <EOL> <NUM_LIT:1> : ProtocolBuffer . Encoder . STRING , <EOL> } , <NUM_LIT:1> , ProtocolBuffer . Encoder . MAX_TYPE ) <EOL> _STYLE = """<STR_LIT>""" <EOL> _STYLE_CONTENT_TYPE = """<STR_LIT>""" <EOL> _PROTO_DESCRIPTOR_NAME = '<STR_LIT>' <EOL> if _extension_runtime : <EOL> pass <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
