
    q	hߊ                     t   S r SrSSKrSSKrSSKrSSKJr  SSKJr  SSKJ	r	  SSKJ
r
  \R                  rS rS	 rS
 r\" S\5      r\" S\5      r\" S\5      r\" S\5      rS rS rS rS rS rS rS r S'S jr\" \
R:                  \5      r\" \
R:                  \5      r\" \
R:                  \5      r \" \
R:                  \5      r!\" \
R:                  \\
RD                  5      r#\" \
R:                  \\
RD                  5      r$\" \
RJ                  S5      r&\" \
RN                  S5      r(\" \
RJ                  S5      r)\" \
RN                  S5      r*\" 5       r+\" 5       r,\" \
R:                  \\-5      r. S'S jr/ S'S jr0S r1S r2\	Rf                  " S\
Rh                  5      r5S  r6S! r7S" r8S# r9S$ r:S(S% jr;S& r<g))a	  Code for decoding protocol buffer primitives.

This code is very similar to encoder.py -- read the docs for that module first.

A "decoder" is a function with the signature:
  Decode(buffer, pos, end, message, field_dict)
The arguments are:
  buffer:     The string containing the encoded message.
  pos:        The current position in the string.
  end:        The position in the string where the current message ends.  May be
              less than len(buffer) if we're reading a sub-message.
  message:    The message object into which we're parsing.
  field_dict: message._fields (avoids a hashtable lookup).
The decoder reads the field and stores it into field_dict, returning the new
buffer position.  A decoder for a repeated field may proactively decode all of
the elements of that field, if they appear consecutively.

Note that decoders may throw any of the following:
  IndexError:  Indicates a truncated message.
  struct.error:  Unpacking of a fixed-width field failed.
  message.DecodeError:  Other errors.

Decoders are expected to raise an exception if they are called with pos > end.
This allows callers to be lax about bounds checking:  it's fineto read past
"end" as long as you are sure that someone else will notice and throw an
exception later on.

Something up the call stack is expected to catch IndexError and struct.error
and convert them to message.DecodeError.

Decoders are constructed using decoder constructors with the signature:
  MakeDecoder(field_number, is_repeated, is_packed, key, new_default)
The arguments are:
  field_number:  The field number of the field we want to decode.
  is_repeated:   Is the field a repeated field? (bool)
  is_packed:     Is the field a packed field? (bool)
  key:           The key to use when looking up the field within field_dict.
                 (This is actually the FieldDescriptor but nothing in this
                 file should depend on that.)
  new_default:   A function which takes a message object as a parameter and
                 returns a new instance of the default value for this field.
                 (This is called for repeated fields and sub-messages, when an
                 instance does not already exist.)

As with encoders, we define a decoder constructor for every type of field.
Then, for every field of every message class we construct an actual decoder.
That decoder goes into a dict indexed by tag, so when we decode a message
we repeatedly read a tag, look up the corresponding decoder, and invoke it.
z kenton@google.com (Kenton Varda)    N)message)
containers)encoder)wire_formatc                     [        U [        R                  5      (       a  [        R                  " SU 5      S:  a  gU (       + $ )a;  Returns whether or not a scalar value is the default value of its type.

Specifically, this should be used to determine presence of implicit-presence
fields, where we disallow custom defaults.

Args:
  value: A scalar value to check.

Returns:
  True if the value is equivalent to a default value, False otherwise.
g      ?r   F)
isinstancenumbersNumbermathcopysign)values    R/var/www/html/env/lib/python3.13/site-packages/google/protobuf/internal/decoder.pyIsDefaultScalarValuer   K   s6     w~~&&4==e+Dq+H      c                 ,   ^ ^ SS[         4U U4S jjjnU$ )a  Return an encoder for a basic varint value (does not include tag).

Decoded values will be bitwise-anded with the given mask before being
returned, e.g. to limit them to 32 bits.  The returned decoder does not
take the usual "end" parameter -- the caller is expected to do bounds checking
after the fact (often the caller can defer such checking until later).  The
decoder returns a (value, new_pos) pair.
posc                 <  > SnSn Uc   U R                  S5      S   nO	X   nUS-  nX$S-  U-  -  nUS-  (       d  UT-  nT" U5      nUc  U$ X!4$ US-  nUS:  a  [	        S5      eMc  ! [         a'  nUS:X  a   S nAg [        S[        U5      -  5      eS nAff = f)	Nr      zFail to read varint %s         @   $Too many bytes when decoding varint.)read
IndexError
ValueErrorstr_DecodeError)bufferr   resultshiftbemaskresult_types         r   DecodeVarint$_VarintDecoder.<locals>.DecodeVarintj   s    FE
		@kk!nQ! Kqd(u$%f$h$V$v76-7qje	"ABB+ 
  	@aZ5A>??	@s   A* *
B4B?BBN)int)r$   r%   r&   s   `` r   _VarintDecoderr*   `   s    C C C4 
r   c                 <   ^^^ SU S-
  -  mSU -  S-
  mUUU4S jnU$ )z0Like _VarintDecoder() but decodes signed values.r   c                    > SnSn X   nX$S-  U-  -  nUS-  nUS-  (       d  UT-  nUT-  T-
  nT" U5      nX!4$ US-  nUS:  a  [        S5      eMM  )Nr   r   r   r   r   r   r   )r   )r   r   r    r!   r"   r$   r%   signbits        r   r&   *_SignedVarintDecoder.<locals>.DecodeVarint   s    FE

+ad(u$%f	Qhc$h$7"g-V$}qje	"ABB r    )bitsr%   r&   r$   r-   s    ` @@r   _SignedVarintDecoderr1      s-     $(O'
t)q$C 
r   l    r   l        c                 x    UnX   S-  (       a  US-  nX   S-  (       a  M  US-  nXU R                  5       nX14$ )a  Read a tag from the memoryview, and return a (tag_bytes, new_pos) tuple.

We return the raw bytes of the tag rather than decoding them.  The raw
bytes can then be used to look up the proper decoder.  This effectively allows
us to trade some work that would be done in pure-python (decoding a varint)
for work that is done in C (searching for a byte string in a hash table).
In a low-level language it would be much cheaper to decode the varint and
use that, but not in Python.

Args:
  buffer: memoryview object of the encoded bytes
  pos: int of the current position to start from

Returns:
  Tuple[bytes, int] of the tag data and new position.
r   r   )tobytes)r   r   start	tag_bytess       r   ReadTagr7      sO    " %d1HC 	d(#3''))	r   c                 J    [        U S5      u  p[        R                  " U5      $ )zDecode a tag from the bytes.

Args:
  tag_bytes: the bytes of the tag

Returns:
  Tuple[int, int] of the tag field number and wire type.
r   )_DecodeVarintr   	UnpackTag)r6   tag_s      r   	DecodeTagr=      s#     9a((3			s	##r   c                    ^ ^  SUU 4S jjnU$ )zReturn a constructor for a decoder for fields of a particular type.

Args:
    wire_type:  The field's wire type.
    decode_value:  A function which decodes an individual value, e.g.
      _DecodeVarint()
c                    >^^^^	^
^ U(       a  [         m	UUU	U4S jnU$ U(       a.  [        R                  " U T5      m
[        T
5      mUUUU
U4S jnU$ UUU4S jnU$ )Nc                   > UR                  T	5      nUc  UR                  T	T" U5      5      nT
" X5      u  paXa-  nXb:  a  [        S5      eX:  a"  T" X5      u  pqUR                  U5        X:  a  M"  X:  a  US	 [        S5      eU$ )NTruncated message.Packed element was truncated.get
setdefaultr   append)r   r   endr   
field_dictr   endpointelementdecode_valuekeylocal_DecodeVarintnew_defaults           r   DecodePackedFieldB_SimpleDecoder.<locals>.SpecificDecoder.<locals>.DecodePackedField   s    s#=''[-AB%,V9>12
2n'4.7
,,w
 n >Bi<=
=
r   c                    > UR                  T	5      nUc  UR                  T	T
" U5      5      n T" X5      u  pgUR                  U5        UT-   nXU T:w  d  Xr:  a  Xr:  a  [        S5      eU$ MA  NrA   )rE   rF   rG   r   )r   r   rH   r   rI   r   rK   new_posrL   rM   rO   r6   tag_lens           r   DecodeRepeatedFieldD_SimpleDecoder.<locals>.SpecificDecoder.<locals>.DecodeRepeatedField   s    s#=''[-AB%+F8
7
,,w
 '!#C I-} !566N r   c                    > T" X5      u  pQX:  a  [        S5      eT(       a$  [        U5      (       a  UR                  TS 5        U$ XTT'   U$ rS   r   r   pop)	r   r   rH   r   rI   	new_valueclear_if_defaultrL   rM   s	         r   DecodeField<_SimpleDecoder.<locals>.SpecificDecoder.<locals>.DecodeField  sR    '4912
2 4Y ? ?
..d
# 
 &S/
r   )r9   r   TagByteslen)field_numberis_repeated	is_packedrM   rO   r\   rP   rV   r]   rN   r6   rU   rL   	wire_types      ```   @@@r   SpecificDecoder'_SimpleDecoder.<locals>.SpecificDecoder   s[    (  	""<;iIg  !  r   Fr/   )rd   rL   re   s   `` r   _SimpleDecoderrh      s     (-1 1f 
r   c                 *   ^^ UU4S jn[        X5      $ )zLike SimpleDecoder but additionally invokes modify_value on every value
before storing it.  Usually modify_value is ZigZagDecode.
c                 ,   > T" X5      u  p#T" U5      U4$ r(   r/   )r   r   r    rT   rL   modify_values       r   InnerDecode%_ModifiedDecoder.<locals>.InnerDecode  s     $V1V '**r   )rh   )rd   rL   rk   rl   s    `` r   _ModifiedDecoderrn     s    + 
		//r   c                 z   ^^^ [         R                  " T5      m[         R                  mUUU4S jn[        X5      $ )zReturn a constructor for a decoder for a fixed-width field.

Args:
    wire_type:  The field's wire type.
    format:  The format string to pass to struct.unpack().
c                 0   > UT-   nT" TXU 5      S   nX24$ )Nr   r/   )r   r   rT   r    formatlocal_unpack
value_sizes       r   rl   '_StructPackDecoder.<locals>.InnerDecode0  s,    JG&&W"56q9Fr   )structcalcsizeunpackrh   )rd   rq   rl   rr   rs   s    ` @@r   _StructPackDecoderrx     s.     v&*, 
		//r   c                  d   ^ [         R                  mU4S jn [        [        R                  U 5      $ )zReturns a decoder for a float field.

This code works around a bug in struct.unpack for non-finite 32-bit
floating-point values.
c                   > US-   nXU R                  5       nUSS S;   aR  USS S:  aI  USS S:w  a  [        R                  U4$ USS S:X  a  [        R                  * U4$ [        R                  U4$ T" S	U5      S   nXB4$ )
a  Decode serialized float to a float and new position.

Args:
  buffer: memoryview of the serialized bytes
  pos: int, position in the memory view to start at.

Returns:
  Tuple[float, int] of the deserialized float value and new position
  in the serialized data.
               r   s        z<f)r4   r   naninf)r   r   rT   float_bytesr    rr   s        r   rl   "_FloatDecoder.<locals>.InnerDecode@  s     AgGW%--/K
 	AaK'K!,<,G	Qq	_	,'""	Qq	W	$	7##hh  
 $,Q/Fr   )ru   rw   rh   r   WIRETYPE_FIXED32rl   rr   s    @r   _FloatDecoderr   7  s)     , B 
44k	BBr   c                  d   ^ [         R                  mU4S jn [        [        R                  U 5      $ )zgReturns a decoder for a double field.

This code works around a bug in struct.unpack for not-a-number.
c                    > US-   nXU R                  5       nUSS S;   a$  USS S:  a  USS S:w  a  [        R                  U4$ T" SU5      S   nXB4$ )	a  Decode serialized double to a double and new position.

Args:
  buffer: memoryview of the serialized bytes.
  pos: int, position in the memory view to start at.

Returns:
  Tuple[float, int] of the decoded double value and new position
  in the serialized data.
   r   r}         r   s         z<d)r4   r   r   )r   r   rT   double_bytesr    rr   s        r   rl   #_DoubleDecoder.<locals>.InnerDecodel  s|     AgGg&..0L
 
a	k	)!A')!A"AAhh  
 $-a0Fr   )ru   rw   rh   r   WIRETYPE_FIXED64r   s    @r   _DoubleDecoderr   d  s(     ,: 
44k	BBr   c                    ^ ^^^^	^
^^ TR                   m	U(       a  [        m
U	U UU
U4S jnU$ U(       a<  [        R                  " T [        R
                  5      m[        T5      mU	UUUU4S jnU$ UU	U U4S jnU$ )z!Returns a decoder for enum field.c                 J  > UR                  T5      nUc  UR                  TT" U5      5      nT" X5      u  paXa-  nXb:  a  [        S5      eX:  a  Un[        X5      u  pUT
R                  ;   a  UR                  U5        OiUR                  (       d  / Ul        [        R                  " T[        R                  5      n	UR                  R                  XXq R                  5       45        X:  a  M  X:  a,  WT
R                  ;   a  US	 OUR                  S	 [        S5      eU$ )a{  Decode serialized packed enum to its value and a new position.

Args:
  buffer: memoryview of the serialized bytes.
  pos: int, position in the memory view to start at.
  end: int, end position of serialized data
  message: Message object to store unknown fields in
  field_dict: Map[Descriptor, Any] to store decoded values in.

Returns:
  int, new position in serialized data.
rA   rB   rC   )rE   rF   r   _DecodeSignedVarint32values_by_numberrG   _unknown_fieldsr   r_   r   WIRETYPE_VARINTr4   )r   r   rH   r   rI   r   rJ   value_start_posrK   r6   	enum_typera   rM   rN   rO   s             r   rP   &EnumDecoder.<locals>.DecodePackedField  s    nnS!e	%%c;w+?@*67oxoh	/00N.v;i000
,,w
((&(G#&&|'2'B'BD) 
!
!
(
(5==?@B N 
i000Bi%%b):;;jr   c                   > UR                  T	5      nUc  UR                  T	T
" U5      5      n [        X5      u  pgUTR                  ;   a  UR	                  U5        OEUR
                  (       d  / Ul        UR
                  R	                  TXU R                  5       45        UT-   nXU T:w  d  Xr:  a  Xr:  a  [        S5      eU$ M  )}  Decode serialized repeated enum to its value and a new position.

Args:
  buffer: memoryview of the serialized bytes.
  pos: int, position in the memory view to start at.
  end: int, end position of serialized data
  message: Message object to store unknown fields in
  field_dict: Map[Descriptor, Any] to store decoded values in.

Returns:
  int, new position in serialized data.
rA   )rE   rF   r   r   rG   r   r4   r   )r   r   rH   r   rI   r   rK   rT   r   rM   rO   r6   rU   s           r   rV   (EnumDecoder.<locals>.DecodeRepeatedField  s     nnS!e	%%c;w+?@26?i000
,,w
((&(G#

!
!
(
(&W-5578:
 #)+w~]344.% r   c                   > Un[        X5      u  paX:  a  [        S5      eT(       a$  [        U5      (       a  UR                  TS5        U$ UT	R                  ;   a  XdT'   U$ UR
                  (       d  / Ul        [        R                  " T
[        R                  5      nUR
                  R                  XpXQ R                  5       45        U$ )r   rA   N)r   r   r   rZ   r   r   r   r_   r   r   rG   r4   )r   r   rH   r   rI   r   
enum_valuer6   r\   r   ra   rM   s           r   r]    EnumDecoder.<locals>.DecodeField  s     o/<z	/00	2:>>sD!
	y11	1$3 j &&$&'
!$$\%0%@%@B	&&3;;=>	@ jr   )r   r9   r   r_   r   r   r`   )ra   rb   rc   rM   rO   r\   rP   rV   r]   r   rN   r6   rU   s   `  ```   @@@@r   EnumDecoderr     st     mm)&* *V   {/J/JKI)nG" "F  @ r   <I<Qz<iz<qc                    ^^^^^	^
^ [         m	U4S jmU(       a   eU(       a=  [        R                  " U [        R                  5      m
[        T
5      mUUU	UU
U4S jnU$ UUUU	4S jnU$ )z%Returns a decoder for a string field.c                    > U R                  5       n [        US5      nU$ ! [         a  nU< STR                  < 3Ul        e SnAff = f)zConvert byte to unicode.zutf-8z in field: N)r4   r   UnicodeDecodeError	full_namereason)memviewbyte_strr   r#   rM   s       r   _ConvertToUnicode(StringDecoder.<locals>._ConvertToUnicode/  sL     H(G$e L  &'7ahs   ! 
A	AA	c                    > UR                  T	5      nUc  UR                  T	T" U5      5      n T
" X5      u  paX-   nXr:  a  [        S5      eUR                  T" XU 5      5        UT-   nXU T:w  d  Xr:X  a  U$ MM  NzTruncated string.rD   )r   r   rH   r   rI   r   sizerT   r   rM   rN   rO   r6   rU   s           r   rV   *StringDecoder.<locals>.DecodeRepeatedField@  s    nnS!e	%%c;w+?@(5*=01
1&v'':;<#)+w~. r   c                    > T
" X5      u  pQX-   nXb:  a  [        S5      eT(       a$  [        U5      (       a  UR                  T	S 5        U$ T" XU 5      UT	'   U$ r   rY   )r   r   rH   r   rI   r   rT   r   r\   rM   rN   s          r   r]   "StringDecoder.<locals>.DecodeFieldQ  sd    &v3kt
g	.//	2488sD! n ,Fw,?@
3nr   r9   r   r_   r   WIRETYPE_LENGTH_DELIMITEDr`   )ra   rb   rc   rM   rO   r\   rV   r]   r   rN   r6   rU   s      ```  @@@@r   StringDecoderr   )  sf     %
   !,!F!FHI)nG  	 	 r   c                    ^^^^^	^
 [         mU(       a   eU(       a<  [        R                  " U [        R                  5      m	[        T	5      m
UUUU	U
4S jnU$ UUU4S jnU$ )z$Returns a decoder for a bytes field.c                   > UR                  T5      nUc  UR                  TT
" U5      5      n T	" X5      u  paX-   nXr:  a  [        S5      eUR                  XU R	                  5       5        UT-   nXU T:w  d  Xr:X  a  U$ MU  r   )rE   rF   r   rG   r4   r   r   rH   r   rI   r   r   rT   rM   rN   rO   r6   rU   s           r   rV   )BytesDecoder.<locals>.DecodeRepeatedFieldi  s    nnS!e	%%c;w+?@(5*=01
1V(0023#)+w~. r   c                    > T	" X5      u  pQX-   nXb:  a  [        S5      eT(       a$  [        U5      (       a  UR                  TS 5        U$ XU R                  5       UT'   U$ r   )r   r   rZ   r4   )
r   r   rH   r   rI   r   rT   r\   rM   rN   s
          r   r]   !BytesDecoder.<locals>.DecodeFieldz  sh    &v3kt
g	.//	2488sD! n !W-557
3nr   r   )ra   rb   rc   rM   rO   r\   rV   r]   rN   r6   rU   s      ```  @@@r   BytesDecoderr   ^  sZ     %  !,!F!FHI)nG  	 r   c                   ^^^^^	^
 [         R                  " U [        R                  5      m[	        T5      mU(       a   eU(       a=  [         R                  " U [        R
                  5      m	[	        T	5      m
UUUUU	U
4S jnU$ UUUU4S jnU$ )z$Returns a decoder for a group field.c                 \  > UR                  T	5      nUc  UR                  T	T
" U5      5      n UR                  T	5      nUc  UR                  T	T
" U5      5      nUR                  5       R                  XU5      nUT-   nXU T:w  d  Xb:  a  [	        S5      eUT-   nXU T:w  d  Xb:X  a  U$ M  NMissing group end tag.)rE   rF   add_InternalParser   )r   r   rH   r   rI   r   rT   end_tag_bytesend_tag_lenrM   rO   r6   rU   s          r   rV   )GroupDecoder.<locals>.DecodeRepeatedField  s    nnS!e	%%c;w+?@s#=''[-AB%iik((c:k/g-/7=56
6#)+w~. r   c                    > UR                  T	5      nUc  UR                  T	T
" U5      5      nUR                  XU5      nUT-   nXU T:w  d  Xb:  a  [        S5      eU$ r   )rE   rF   r   r   )r   r   rH   r   rI   r   rT   r   r   rM   rO   s          r   r]   !GroupDecoder.<locals>.DecodeField  sj    nnS!e	%%c;w+?@  c2cKg	G		-344nr   )r   r_   r   WIRETYPE_END_GROUPr`   WIRETYPE_START_GROUP)ra   rb   rc   rM   rO   rV   r]   r   r   r6   rU   s      ``  @@@@r   GroupDecoderr     s     ""<#.#A#AC-M"+  !,!A!ACI)nG & 
 
 r   c                    ^^^^^	 [         mU(       a   eU(       a<  [        R                  " U [        R                  5      m[        T5      m	UUUUU	4S jnU$ UUU4S jnU$ )z&Returns a decoder for a message field.c                 $  > UR                  T5      nUc  UR                  TT
" U5      5      n T	" X5      u  paX-   nXr:  a  [        S5      eUR                  5       R	                  XU5      U:w  a  [        S5      eUT-   nXU T:w  d  Xr:X  a  U$ Mc  NrA   Unexpected end-group tag.)rE   rF   r   r   r   r   s           r   rV   +MessageDecoder.<locals>.DecodeRepeatedField  s    nnS!e	%%c;w+?@(5*=12
299;%%f7;wF 89
9#)+w~. r   c                    > UR                  T5      nUc  UR                  TT
" U5      5      nT	" X5      u  paX-   nXr:  a  [        S5      eUR                  XU5      U:w  a  [        S5      eU$ r   )rE   rF   r   r   )r   r   rH   r   rI   r   r   rT   rM   rN   rO   s           r   r]   #MessageDecoder.<locals>.DecodeField  sy    nnS!e	%%c;w+?@&v3kt
g	/00			f7	3w	> 677nr   r   )
ra   rb   rc   rM   rO   rV   r]   rN   r6   rU   s
      ``  @@@r   MessageDecoderr     sZ     %  !,!F!FHI)nG (  r   r   c                   ^^^^^ [         R                  " S[        R                  5      m[         R                  " S[        R                  5      m[         R                  " S[        R
                  5      m[        m[        mUUUUU4S jnU$ )a  Returns a decoder for a MessageSet item.

The parameter is the message Descriptor.

The message set message looks like this:
  message MessageSet {
    repeated group Item = 1 {
      required int32 type_id = 2;
      required string message = 3;
    }
  }
r~   r|   r   c                 .  > UnSnSnSn T" X5      u  pU	T:X  a  T" X5      u  paOJU	T:X  a  T" X5      u  pXz-   =pO4U	T:X  a  O/[        U	5      u  p[        XX+U5      u  pUS:X  a  [        S5      eMg  X:  a  [        S5      eUS:X  a  [        S5      eUS:X  a  [        S5      eUR                  R	                  U5      nUb  UR                  U5      nUcR  UR                  n[        US5      (       d  [        R                  U5        UR                  UUR                  5       5      nUR                  XU5      U:w  a  [        S5      e U$ UR                  (       d  / Ul        UR                  R                  [        XU R!                  5       45        U$ )ay  Decode serialized message set to its value and new position.

Args:
  buffer: memoryview of the serialized bytes.
  pos: int, position in the memory view to start at.
  end: int, end position of serialized data
  message: Message object to store unknown fields in
  field_dict: Map[Descriptor, Any] to store decoded values in.

Returns:
  int, new position in serialized data.
rB   r   rA    MessageSet item missing type_id. MessageSet item missing message._concrete_class)r=   _DecodeUnknownFieldr   
Extensions_FindExtensionByNumberrE   message_typehasattrmessage_factoryGetMessageClassrF   r   r   r   rG   MESSAGE_SET_ITEM_TAGr4   )r   r   rH   r   rI   message_set_item_starttype_idmessage_startmessage_endr6   r   ra   rd   r<   	extensionr   r   item_end_tag_bytesrN   local_ReadTagmessage_tag_bytestype_id_tag_bytess                    r   
DecodeItem)MessageSetItemDecoder.<locals>.DecodeItem  s    !GMK &v3y	'	'+F8#)) 26 ?)00k**"+I"6$V#YO"989
9  y-.."};<<;<<""99'BInnY'e	 --|%677

)
),
7%%|3357			fK	@K	O 677 
P J $$"$$$s!C!K!K!M
NP Jr   )r   r_   r   r   r   r   r7   r9   )
descriptorr   r   rN   r   r   r   s     @@@@@r   MessageSetItemDecoderr     sp     &&q+*E*EF&&q+*O*OP'';+I+IJ-$@ @D 
r   c                     ^^^ [         R                  " S[        R                  5      m[         R                  " S[        R                  5      m[         R                  " S[        R
                  5      mUUU4S jn U $ )z0Returns a decoder for a Unknown MessageSet item.r~   r|   r   c                   > Sn[        U 5      nSnSn [        X5      u  pQUT:X  a  [        X5      u  paOMUT:X  a  [        X5      u  psX7-   =pO4UT:X  a  O/[        U5      u  p[	        XX(U	5      u  pUS:X  a  [        S5      eMp  X:  a  [        S5      eWS:X  a  [        S5      eUS:X  a  [        S5      eX`X4 R                  5       4$ )Nr   rB   r   rA   r   r   )r`   r7   r9   r=   r   r   r4   )r   r   rH   r   r   r6   r   r   ra   rd   r<   r   r   r   s              r   DecodeUnknownItem7UnknownMessageSetItemDecoder.<locals>.DecodeUnknownItemM  s    
C
f+CMK
 -y	'	'&v3#)) -f :)00k**"+I"6$V#YO"989
9  y-.."};<<;<<M6>>@AAr   )r   r_   r   r   r   r   )r   r   r   r   s    @@@r   UnknownMessageSetItemDecoderr   F  s^     &&q+*E*EF&&q+*O*OP'';+I+IJB< 
r   c                    ^^^^^^^ U m[         R                  " U R                  [        R                  5      m[        T5      m[        mU R                  mUUUUUUU4S jnU$ )z"Returns a decoder for a map field.c                   > TR                  5       nUR                  T
5      nUc  UR                  T
T" U5      5      n T" X5      u  pqX-   nX:  a  [        S5      eUR	                  5         UR                  XU5      U:w  a  [        S5      eT	(       a(  XeR                     R                  UR                  5        OUR                  XeR                  '   UT-   nXU T:w  d  X:X  a  U$ M  r   )	r   rE   rF   r   Clearr   rM   CopyFromr   )r   r   rH   r   rI   submsgr   r   rT   is_message_maprM   rN   r   rO   r6   rU   s            r   	DecodeMapMapDecoder.<locals>.DecodeMapz  s    ))+FNN3E}##CW)=>e
&v3kt
g	/00lln			vG	4	? 677	jj""6<<0"LLjj gc				)W^- r   )r   r_   numberr   r   r`   r9   r   )	field_descriptorrO   r   r   rM   rN   r   r6   rU   s	    `` @@@@@r   
MapDecoderr   o  sY     	#/66*DDF)	N'$!.., : 
r   c                 H    US-   n[         R                  " SXU 5      S   U4$ )zDecode a fixed64.r   r   r   ru   rw   r   r   rT   s      r   _DecodeFixed64r     s+    !G'
--f1
21
5w	??r   c                 H    US-   n[         R                  " SXU 5      S   U4$ )zDecode a fixed32.r{   r   r   r   r   s      r   _DecodeFixed32r    s-     !G'
--f1
21
5w	??r   c                 2   [         R                  " 5       nUb  X:  ax  [        X5      u  pA[        US5      u  pV[        R
                  " U5      u  pxU[        R                  :X  a   X14$ [        XX'U5      u  pUR                  XxU	5        Uc  Mq  X:  a  Mx  X14$ )zFDecode UnknownFieldSet.  Returns the UnknownFieldSet and new position.r   )	r   UnknownFieldSetr7   r9   r   r:   r   r   _add)
r   r   end_posunknown_field_setr6   r;   r<   ra   rd   datas
             r   _DecodeUnknownFieldSetr    s     !0023=v+YY*HS)33C8LK222 	!! &WIKT <D9 	3= 	!!r   c                 x   U[         R                  :X  a  [        X5      u  pQGOU[         R                  :X  a  [	        X5      u  pQOU[         R
                  :X  a  [        X5      u  pQOU[         R                  :X  a&  [        X5      u  paXX-    R                  5       nX-  nOU[         R                  :X  aS  [        R                  " U[         R                  5      n[        XU5      u  pQX[        U5      -
  U U:w  a  [        S5      eO U[         R                  :X  a  g[        S5      eX:  a  [        S5      eXQ4$ )zCDecode a unknown field.  Returns the UnknownField and new position.r   )r   rB   zWrong wire type in tag.rA   )r   r   r9   r   r   r   r  r   r4   r   r   r_   r   r  r`   r   )r   r   r  ra   rd   r  r   r   s           r   r   r     s%    +---,KT3K000 -KT3K000 -KT3K999,KTch'')DKCK444$$k44M 'vG<IDC&&->122 ?K222
0
11]
+
,,
r   rg   r(   )=__doc__
__author__r   r	   ru   google.protobufr   google.protobuf.internalr   r   r   DecodeErrorr   r   r*   r1   r)   r9   _DecodeSignedVarint_DecodeVarint32r   r7   r=   rh   rn   rx   r   r   r   r   Int32DecoderInt64DecoderUInt32DecoderUInt64DecoderZigZagDecodeSInt32DecoderSInt64Decoderr   Fixed32Decoderr   Fixed64DecoderSFixed32DecoderSFixed64DecoderFloatDecoderDoubleDecoderboolBoolDecoderr   r   r   r   r_   r   r   r   r   r   r   r  r  r   r/   r   r   <module>r      s  0d 0
    # / , 0
 ""*$N0 }c2*2s3  !4,R5 4
$ <~002*CZ%CR "'z@ !68 !46 {::OL{::MJ +2J2JL 0H0HJ %[%A%A4H$[%A%A4H$[%A%A4H$[%A%A4H 6
 $)2l #(&R,^/h '';+K+KL Wt%R(V@@"&r   