zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
U
£ý°d"ã@s¨dZdZddlZddlmZddlmZdZde>dZdZdZ    dZ
dZ d    Z d
Z d
Zed ƒZed ƒZd ZdZdZdZdZdZdZdZe e¡d    kršedƒ‚e e¡dkr°edƒ‚dd„Zdd„Zdd„Zdd„Zd d!„Z d"d#„Z!d$d%„Z"d&d'„Z#d(d)„Z$d*d+„Z%d,d-„Z&d.d/„Z'd0d1„Z(d2d3„Z)d4d5„Z*d6d7„Z+d8d9„Z,d:d;„Z-d<d=„Z.d>d?„Z/d@dA„Z0dBdC„Z1dDdE„Z2dFdG„Z3dHdI„Z4dJdK„Z5ej6j7ej6j8ej6j9ej6j:fZ;dLdM„Z<dS)NzFConstants and static functions to support protocol buffer wire format.z#robinson@google.com (Will Robinson)éN)Ú
descriptor)Úmessageéééééiÿÿÿi€lÿÿìÿÿÿÿlûÿÿÿìÿÿÿÿz<Iz<Qz<fz<dz"Format "I" is not a 32-bit number.éz"Format "Q" is not a 64-bit number.cCs0d|krtks$nt d|¡‚|t>|BS)aReturns an unsigned 32-bit integer that encodes the field number and
  wire type information in standard protocol message wire format.
 
  Args:
    field_number: Expected to be an integer in the range [1, 1 << 29)
    wire_type: One of the WIRETYPE_* constants.
  rzUnknown wire type: %d)Ú _WIRETYPE_MAXrÚ EncodeErrorÚ TAG_TYPE_BITS)Ú field_numberZ    wire_type©rú[d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\google/protobuf/internal/wire_format.pyÚPackTagPsrcCs|t?|t@fS)zkThe inverse of PackTag().  Given an unsigned 32-bit number,
  returns a (field_number, wire_type) tuple.
  )rÚ TAG_TYPE_MASK)ÚtagrrrÚ    UnpackTag]srcCs|dkr|d>S|d>dAS)z‘ZigZag Transform:  Encodes signed integers so that they can be
  effectively used with varint encoding.  See wire_format.h for
  more details.
  rréÿÿÿÿr©ÚvaluerrrÚ ZigZagEncodedsrcCs|d@s|d?S|d?dAS)zInverse of ZigZagEncode().rrrrrrrÚ ZigZagDecodensrcCs
t||ƒS©N)Ú Int64ByteSize©rÚint32rrrÚ Int32ByteSizezsrcCs td|@ƒS©Nr
)Ú_VarUInt64ByteSizeNoTag)rrrrÚInt32ByteSizeNoTag~sr"cCst|d|@ƒSr ©ÚUInt64ByteSize©rÚint64rrrr‚srcCs
t||ƒSrr#)rZuint32rrrÚUInt32ByteSize‡sr'cCst|ƒt|ƒSr)Ú TagByteSizer!)rÚuint64rrrr$‹sr$cCst|t|ƒƒSr)r'rrrrrÚSInt32ByteSizesr*cCst|t|ƒƒSr)r$rr%rrrÚSInt64ByteSize“sr+cCs t|ƒdS©Nr©r()rZfixed32rrrÚFixed32ByteSize—sr.cCs t|ƒdS©Nr r-)rZfixed64rrrÚFixed64ByteSize›sr0cCs t|ƒdSr,r-)rZsfixed32rrrÚSFixed32ByteSizeŸsr1cCs t|ƒdSr/r-)rZsfixed64rrrÚSFixed64ByteSize£sr2cCs t|ƒdSr,r-)rZfltrrrÚ FloatByteSize§sr3cCs t|ƒdSr/r-)rÚdoublerrrÚDoubleByteSize«sr5cCs t|ƒdS)Nrr-©rÚbrrrÚ BoolByteSize¯sr8cCs
t||ƒSr)r')rÚenumrrrÚ EnumByteSize³sr:cCst|| d¡ƒS)Nzutf-8)Ú BytesByteSizeÚencode)rÚstringrrrÚStringByteSize·sr>cCst|ƒtt|ƒƒt|ƒSr)r(r!Úlenr6rrrr;»s
 
ÿþr;cCsdt|ƒ| ¡S)Nr)r(ÚByteSize©rrrrrÚ GroupByteSizeÁs
ÿrBcCst|ƒt| ¡ƒ| ¡Sr©r(r!r@rArrrÚMessageByteSizeÆs
 
ÿþrDcCsHdtdƒtdƒtdƒ}|t|ƒ7}| ¡}|t|ƒ7}||7}|S)NrrrrC)rÚmsgZ
total_sizeZ message_sizerrrÚMessageSetItemByteSizeÌs   rFcCstt|dƒƒS)zEReturns the bytes required to serialize a tag with this field number.r)r!r)rrrrr(àsr(cCs†|dkr dS|dkrdS|dkr$dS|dkr0dS|d    kr<d
S|d krHd S|d krTdS|dkr`dS|dkrldS|tkr‚t d|¡‚dS)z©Returns the number of bytes required to serialize a single varint
  using boundary value comparisons. (unrolled loop optimization -WPierce)
  uint64 must be unsigned.
  ériÿ?riÿÿriÿÿÿrlÿÿrlÿÿÿélÿÿÿélÿÿÿÿr r    é    zValue out of range: %dé
)Ú
UINT64_MAXrr )r)rrrr!ès*r!cCs|tkS)z·Return true iff packable = true is valid for fields of this type.
 
  Args:
    field_type: a FieldDescriptor::Type value.
 
  Returns:
    True iff fields of this type are packable.
  )ÚNON_PACKABLE_TYPES)Z
field_typerrrÚIsTypePackables    rN)=Ú__doc__Ú
__author__ÚstructZgoogle.protobufrrrrZWIRETYPE_VARINTZWIRETYPE_FIXED64ZWIRETYPE_LENGTH_DELIMITEDZWIRETYPE_START_GROUPZWIRETYPE_END_GROUPZWIRETYPE_FIXED32r ÚintZ    INT32_MAXZ    INT32_MINZ
UINT32_MAXZ    INT64_MAXZ    INT64_MINrLZFORMAT_UINT32_LITTLE_ENDIANZFORMAT_UINT64_LITTLE_ENDIANZFORMAT_FLOAT_LITTLE_ENDIANZFORMAT_DOUBLE_LITTLE_ENDIANÚcalcsizeÚAssertionErrorrrrrrr"rr'r$r*r+r.r0r1r2r3r5r8r:r>r;rBrDrFr(r!ZFieldDescriptorZ TYPE_STRINGZ
TYPE_GROUPZ TYPE_MESSAGEZ
TYPE_BYTESrMrNrrrrÚ<module>sv    
 ü