+
    i                     *   R t ^ RIt^ RIt^ RIt^ RItR:t ! R R]P                  4      t^R^R^R^R	/t^R
^R^R^R/t	^R^R/t
R tR tR tR tR tR tR tR tR 3R lt ! R R]P                  4      t ! R R4      t ! R R4      t ! R R ]4      t ! R! R"]4      t ! R# R$]4      t ! R% R&]4      t ! R' R(]4      t ! R) R*]4      t ! R+ R,]4      t ! R- R.4      tR/ t ! R0 R14      t R2 t!R3 t" ! R4 R54      t# ! R6 R4      t$R7 t%R8 t&R9 t'R# );zImplementation of FlexBuffers binary format.

For more info check https://google.github.io/flatbuffers/flexbuffers.html and
corresponding C++ implementation at
https://github.com/google/flatbuffers/blob/master/include/flatbuffers/flexbuffers.h
NTypeBuilderc                   t   a  ] tR t^!t o Rt^ t^t^t^t]	R 4       t
]	R 4       t]	R 4       t]	R 4       tRtV tR# )BitWidthzSupported bit widths of value types.

These are used in the lower 2 bits of a type field to determine the size of
the elements (and or size field) of the item pointed to (e.g. vector).
c                    V ^ 8  g   Q hV R8  d   \         P                  # V R8  d   \         P                  # V R8  d   \         P                  # V R8  d   \         P                  # \        RV ,          4      h)z@Returns the minimum `BitWidth` to encode unsigned integer value.zvalue is too big to encode: %s   i   l        l            )r   W8W16W32W64
ValueErrorvalues   &U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/flatbuffers/flexbuffers.pyU
BitWidth.U-   si     A::[[	'	\\	'	\\	'	\\7%?@@    c                Z    V ^,          p \         P                  V ^ 8  d   V 4      # V ( 4      # )z>Returns the minimum `BitWidth` to encode signed integer value.)r   r   r   s   &r   I
BitWidth.I=   s,     
QJE::uze66v66r   c                    \         P                  ! R\         P                  ! RV 4      4      ^ ,          V 8X  d   \        P                  # \        P
                  # )z6Returns the `BitWidth` to encode floating point value.z<f)structunpackpackr   r
   r   r   s   &r   F
BitWidth.FL   s;     }}T6;;tU34Q75@\\<<r   c                    ^\         P                  ^\         P                  ^\         P                  ^\         P                  /V ,          #    )r   r   r	   r
   r   
byte_widths   &r   B
BitWidth.BS   s3    x{{Ax||QaN r    N)__name__
__module____qualname____firstlineno____doc__r   r	   r
   r   staticmethodr   r   r   r!   __static_attributes____classdictcell____classdict__s   @r   r   r   !   sp      	"	#	#	#A A 7 7    r   r   bhiqr!   Hr   Qfdc                 l    \         P                  ! R V \        V4      ,          ,          V4      ^ ,          # z<%s)r   r   len)fmtbufs   &&r   _Unpackr;   _   s%    	us3s8},c	21	55r   c                 r    \        V4      V,          p\        P                  ! R W V,          3,          V4      # z<%d%s)r8   r   r   )r9   r:   lengthr    s   &&& r   _UnpackVectorr?   c   s-    3x6!*	w&j/!::C	@@r   c                 J    \         P                  ! R W,          ,          V4      # r7   )r   r   )r9   r   r    s   &&&r   _PackrA   h   s    	US_,e	44r   c                 b    \         P                  ! R \        V4      W,          3,          .VO5!  # r=   )r   r   r8   )r9   valuesr    s   &&&r   _PackVectorrD   l   s&    	WFS_==	G	GGr   c                 D    ^V,          V8:  d   \        WV4      VRV% R# R# )r   NTF)rA   )r9   r:   r   r    value_bit_widths   &&&&&r   _MutaterG   p   s(    ?z)S4C	r   c                 $    V ) V^,
          ,          # r   r#   )buf_sizescalar_sizes   &&r   _PaddingBytesrK   z   s    
kAo	&&r   c                     YP                   f   ^ MV P                   ,           pYP                  f   TMV P                  ,           p\        W4V P                  4      # N)startstopslicestep)soffsetr>   rN   rO   s   &&&  r   _ShiftSlicerT      s?    
Aagg
6%	VV^6	8$	uAFF	##r   c                    ^ \        V 4      rCWC,
          pV^ 8  dI   TpV^,          pWg,          pV! W,          V4      '       d   V^,          pTpWW^,           ,          pKK  TpKO  V# )z3Implementation of C++ std::lower_bound() algorithm.)r8   )rC   r   predfirstlastcountr0   rQ   s   &&&     r   _LowerBoundrZ      sc    3v;
,%	AA:DIAFIu1faeaxee	,r   c                 
    W8  # rM   r#   )xys   &&r   <lambda>r^      s    15r   c                l    \        WV4      pV\        V 4      8w  d   V! WV,          4      '       g   V# R# )z5Implementation of C++ std::binary_search() algorithm.)rZ   r8   )rC   r   rV   indexs   &&& r   _BinarySearchrb      s2    
fT
*%
c&k$uUm"<"<L	)r   c                   8  a  ] tR t^t o Rt^ t^t^t^t^t	^t
^t^t^t^	t^
t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^$t ]!R 4       t"]!R 4       t#]!R 4       t$]!R 4       t%]!R 4       t&]!R 4       t']!R 4       t(]!R	 4       t)]!R
 4       t*]!RR l4       t+Rt,V t-R# )r   zrSupported types of encoded data.

These are used as the upper 6 bits of a type field to indicate the actual
type.
c                4    \        V 4      ^,          V,          # )   )int)type_	bit_widths   &&r   Pack	Type.Pack   s    J!Oy((r   c                F    ^V ^,          ,          \        V ^,	          4      3# r   )r   packed_types   &r   UnpackType.Unpack   s!    t#$d;!+;&<<<r   c                ^    V \         P                  8*  ;'       g    V \         P                  8H  # rM   )r   FLOATBOOLrg   s   &r   IsInlineType.IsInline   s"    DJJ44%499"44r   c                    \         P                  T u;8*  ;'       d    \         P                  8*  Mu ;'       g    V \         P                  8H  # rM   )r   
VECTOR_INTVECTOR_STRING_DEPRECATEDVECTOR_BOOLrs   s   &r   IsTypedVectorType.IsTypedVector   s;     	5AAD$A$AA 	% 	%D$$$r   c                    \         P                  T u;8*  ;'       d    \         P                  8*  Mu ;'       g    V \         P                  8H  # rM   )r   INTSTRINGrr   rs   s   &r   IsTypedVectorElementTypeType.IsTypedVectorElementType   s.    88u+++AAu		/AAr   c                    \         P                  V 4      '       g   \        R 4      h\        V \         P                  ,
          \         P                  ,           4      # )zmust be typed vector type)r   rz   r   rw   r}   rs   s   &r   ToTypedVectorElementTypeType.ToTypedVectorElementType   s<    e$$233'$((233r   c                f    \         P                  T u;8*  ;'       d    \         P                  8*  # u # rM   )r   VECTOR_INT2VECTOR_FLOAT4rs   s   &r   IsFixedTypedVectorType.IsFixedTypedVector   s'    u::(:(:::::r   c                f    \         P                  T u;8*  ;'       d    \         P                  8*  # u # rM   )r   r}   rq   rs   s   &r   IsFixedTypedVectorElementType"Type.IsFixedTypedVectorElementType   s#    88u**

****r   c                    \         P                  V 4      '       g   \        R 4      hV \         P                  ,
          p\        V^,          \         P                  ,           4      V^,          ^,           3# )zmust be fixed typed vector type)r   r   r   r   r}   )rg   
fixed_types   & r   ToFixedTypedVectorElementType"Type.ToFixedTypedVectorElementType   sW    ""5))899 )))J
Q)*J!Oa,???r   c                4   V^ 8X  d(   \         P                  V 4      '       g   \        R4      hM&\         P                  V 4      '       g   \        R4      hV \         P                  ,
          pV^ 8X  d!   \        V\         P
                  ,           4      # V^8X  d!   \        V\         P                  ,           4      # V^8X  d!   \        V\         P                  ,           4      # V^8X  d!   \        V\         P                  ,           4      # \        RV,          4      h)zConverts element type to corresponding vector type.

Args:
  element_type: vector element type
  fixed_len: number of elements: 0 for typed vector; 2, 3, or 4 for fixed
    typed vector.

Returns:
  Typed vector type or fixed typed vector type.
z!must be typed vector element type'must be fixed typed vector element typezunsupported fixed_len: %s)	r   r   r   r   r}   rw   r   VECTOR_INT3VECTOR_INT4)element_type	fixed_lenrS   s   && r   ToTypedVectorType.ToTypedVector   s     A~**<88<== 9 //==BCCDHH$FA~&4??*++	a&4+++,,	a&4+++,,	a&4+++,,2Y>??r   r#   N    ).r$   r%   r&   r'   r(   NULLr}   UINTrq   KEYr~   INDIRECT_INTINDIRECT_UINTINDIRECT_FLOATMAPVECTORrw   VECTOR_UINTVECTOR_FLOAT
VECTOR_KEYrx   r   VECTOR_UINT2VECTOR_FLOAT2r   VECTOR_UINT3VECTOR_FLOAT3r   VECTOR_UINT4r   BLOBrr   ry   r)   ri   rn   rt   rz   r   r   r   r   r   r   r*   r+   r,   s   @r   r   r      sg     
$	#	
$
%	#&,-.	#&*+,*  +,-+,-+,-	$	$+) ) = = 5 5   B B 4 4 ; ; + + @ @ @ @r   c                   N   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )Bufi  zHClass to access underlying buffer object starting from the given offset.c                    Wn         V^ 8  d   TM\        V4      V,           V n        \        V4      V P                  ,
          V n        R# r   N)_bufr8   _offset_length)selfr:   rS   s   &&&r   __init__Buf.__init__  s3    I#q[6c#h.?DLs8dll*DLr   c                   \        V\        4      '       d2   V P                  \        WP                  V P
                  4      ,          # \        V\        4      '       d%   V P                  V P                  V,           ,          # \        R 4      h)invalid key type
isinstancerP   r   rT   r   r   rf   	TypeErrorr   keys   &&r   __getitem__Buf.__getitem__!  s^    #uYY{3dllCDD	C		YYt||c)**())r   c                   \        V\        4      '       d/   W P                  \        WP                  V P
                  4      &   R# \        V\        4      '       d"   WP                  V P                  V,           &   R# \        R 4      h)r   Nr   )r   r   r   s   &&&r   __setitem__Buf.__setitem__)  sX    #u@EiiCt||<=	C		&)iis"#())r   c                (    R V P                   ,          # )zbuf[%d:])r   r   s   &r   __repr__Buf.__repr__1  s    $$r   c                R    V P                   V P                  R P                  V4      # )z<Returns the lowest index where the sub subsequence is found.N)r   r   find)r   subs   &&r   FindBuf.Find4  s"    99T\\^$))#..r   c                P    \        V P                  V P                  V,           4      # )z5Returns new `Buf` which starts from the given offset.)r   r   r   )r   rS   s   &&r   Slice	Buf.Slice8  s    tyy$,,/00r   c           
     ^    V P                  V\        \        WW,            4      ,
          4      # )zAReturn new `Buf` based on the encoded offset (indirect encoding).)r   r;   r   )r   rS   r    s   &&&r   IndirectBuf.Indirect<  s%    ::fwq$8K*LMMNNr   )r   r   r   N)r$   r%   r&   r'   r(   r   r   r   r   r   r   r   r*   r+   r,   s   @r   r   r     s2     P+
**%/1O Or   r   c                   >   a  ] tR tRt o RtRtR t]R 4       tRt	V t
R# )ObjectiA  z.Base class for all non-trivial data accessors.c                    Wn         W n        R # rM   r   _byte_width)r   r:   r    s   &&&r   r   Object.__init__F  s    I!r   c                    V P                   # rM   )r   r   s   &r   	ByteWidthObject.ByteWidthJ  s    r   r   N)r$   r%   r&   r'   r(   	__slots__r   propertyr   r*   r+   r,   s   @r   r   r   A  s&     6#)"  r   r   c                   T   a a ] tR tRt oRtRtRV 3R llt]R 4       tR t	Rt
VtV ;t# )SizediO  zBBase class for all data accessors which need to read encoded size.c                   < \         SV `  W4       V^ 8X  d"   \        \        V P                  4      V n        R# W0n        R# r   )superr   r;   r   	SizeBytes_size)r   r:   r    size	__class__s   &&&&r   r   Sized.__init__T  s.    	GS%qy1dnn-djjr   c                6    V P                   V P                  ) ^  # r   r   r   s   &r   r   Sized.SizeBytes[  s    99d&&&++r   c                    V P                   # rM   r   r   s   &r   __len__Sized.__len___  s    ::r   r   r   )r$   r%   r&   r'   r(   r   r   r   r   r   r*   r+   __classcell__r   r-   s   @@r   r   r   O  s0     J) , , r   r   c                   >   a  ] tR tRt o RtRt]R 4       tR tRt	V t
R# )Blobic  z)Data accessor for the encoded blob bytes.c                2    V P                   ^ \        V 4       # r   r   r8   r   s   &r   Bytes
Blob.Bytesh      99QT##r   c                >    R V P                   \        V 4      3,          # )zBlob(%s, size=%d)r   r   s   &r   r   Blob.__repr__l  s    $))SY!777r   r#   N)r$   r%   r&   r'   r(   r   r   r   r   r*   r+   r,   s   @r   r   r   c  s)     1)$ $8 8r   r   c                   J   a  ] tR tRt o RtRt]R 4       tR tR t	R t
RtV tR# )	Stringip  z+Data accessor for the encoded string bytes.c                2    V P                   ^ \        V 4       # r   r   r   s   &r   r   String.Bytesu  r   r   c                D   VP                  R4      p\        V4      pV\        V 4      8:  dt   \        \        W0P                  4      V P
                  V P                  ) ^ % W P
                  ^ V% \        \        V 4      V,
          4      V P
                  V\        V 4      % R# R# )a  Mutates underlying string bytes in place.

Args:
  value: New string to replace the existing one. New string must have less
    or equal UTF-8-encoded bytes than the existing one to successfully
    mutate underlying byte buffer.

Returns:
  Whether the value was mutated or not.
utf-8TF)encoder8   rA   r   r   r   	bytearray)r   r   encodedns   &&  r   MutateString.Mutatey  s     ll7#GGACI~).q!5E5E)Fdii!!!A&ii!n!*3t9q=!9diiCIr   c                8    V P                   P                  R 4      # )r   r   decoder   s   &r   __str__String.__str__      ::W%%r   c                >    R V P                   \        V 4      3,          # )zString(%s, size=%d)r   r   s   &r   r   String.__repr__  s     DIIs4y#999r   r#   N)r$   r%   r&   r'   r(   r   r   r   r   r  r   r*   r+   r,   s   @r   r   r   p  s3     3)$ $(&: :r   r   c                   \   a a ] tR tRt oRtRtV 3R lt]R 4       tR t	R t
R tRtVtV ;t# )	Keyi  z(Data accessor for the encoded key bytes.c                8   < V^8X  g   Q h\         SV `  W4       R# )r   N)r   r   )r   r:   r    r   s   &&&r   r   Key.__init__  s    ??	GS%r   c                2    V P                   ^ \        V 4       # r   r   r   s   &r   r   	Key.Bytes  r   r   c                8    V P                   P                  ^ 4      # r   )r   r   r   s   &r   r   Key.__len__  s    99>>!r   c                8    V P                   P                  R 4      # )asciir  r   s   &r   r  Key.__str__  r  r   c                >    R V P                   \        V 4      3,          # )zKey(%s, size=%d)r   r   s   &r   r   Key.__repr__      CI 666r   r#   )r$   r%   r&   r'   r(   r   r   r   r   r   r  r   r*   r+   r   r   s   @@r   r
  r
    s:     0)& $ $&7 7r   r
  c                   D   a  ] tR tRt o RtRtR t]R 4       tR t	Rt
V tR# )Vectori  z+Data accessor for the encoded vector bytes.c                h   V^ 8  g   V\        V 4      8  d   \        RV\        V 4      3,          4      hV P                  \        V 4      V P                  ,          V,           ,          pV P                  P	                  WP                  ,          4      p\
        P                  W0P                  V4      # r   z'vector index %s is out of [0, %d) range)r8   
IndexErrorr   r   r   Ref
PackedType)r   ra   rm   r:   s   &&  r   r   Vector.__getitem__  s    qyESY&
3uc$i6H
H  ))CI(8(885@AK
))//%"2"22
3C>>#//==r   c                B    V  Uu. uF  qP                   NK  	  up# u upi )z5Returns the underlying encoded data as a list object.)Valuer   es   & r   r   Vector.Value  s     ""TGGT"""s   c                V    R V P                   V P                  V P                  3,          # )z"Vector(%s, byte_width=%d, size=%d))r   r   r   r   s   &r   r   Vector.__repr__  s+    /		

3  r   r#   N)r$   r%   r&   r'   r(   r   r   r   r   r   r*   r+   r,   s   @r   r  r    s0     3)> # # r   r  c                   z   a a ] tR tRt oRtR
tRV 3R llt]R 4       t]R 4       t	R t
]R 4       tR tR	tVtV ;t# )TypedVectori  zGData accessor for the encoded typed vector or fixed typed vector bytes.c                ~   < \         SV `  WV4       V\        P                  8X  d   \        P                  pW0n        R # rM   )r   r   r   r~   r   _element_type)r   r:   r    r   r   r   s   &&&&&r   r   TypedVector.__init__  s/    	GSd+t{{" XXl%r   c                T    V P                   R V P                  \        V 4      ,           # rM   )r   r   r8   r   s   &r   r   TypedVector.Bytes  s#    993t''#d)344r   c                    V P                   # rM   r)  r   s   &r   ElementTypeTypedVector.ElementType  s    r   c                   V^ 8  g   V\        V 4      8  d   \        RV\        V 4      3,          4      hV P                  P                  WP                  ,          4      p\        W P                  ^V P                  4      # r  )r8   r  r   r   r   r  r)  )r   ra   r:   s   && r   r   TypedVector.__getitem__  sj    qyESY&
3uc$i6H
H  ))//%"2"22
3Cs$$a););<<r   c           	        V '       g   . # V P                   \        P                  J d>   \        \        V P
                  \        V 4      4       Uu. uF  p\        V4      NK  	  up# V P                   \        P                  J d.   \        \        \        V P
                  \        V 4      4      4      # V P                   \        P                  J d.   \        \        \        V P
                  \        V 4      4      4      # V P                   \        P                  J d.   \        \        \        V P
                  \        V 4      4      4      # V P                   \        P                  J d   V  Uu. uF  qP                  NK  	  up# V P                   \        P                   J d   V  Uu. uF  qP"                  NK  	  up# \%        RV P                   ,          4      hu upi u upi u upi )z'Returns underlying data as list object.unsupported element_type: %s)r)  r   rr   r?   r   r   r8   boolr}   listr   r   rq   r   r   AsKeyr~   AsStringr   r!  s   & r   r   TypedVector.Value  sK    iTYY&,Q

CIFGF!d1gFGG			txx	'-4::s4y9::			tyy	(-4::s4y9::			tzz	)-4::s4y9::			txx	'#$t!ggt$$			t{{	*"&'$Qjj$''4t7I7IIJJ H %'s   G)G"Gc                l    R V P                   V P                  V P                  V P                  3,          # )z8TypedVector(%s, byte_width=%d, element_type=%s, size=%d))r   r   r)  r   r   s   &r   r   TypedVector.__repr__   s5    E		

	I  r   r.  )r)  r   r   )r$   r%   r&   r'   r(   r   r   r   r   r/  r   r   r   r*   r+   r   r   s   @@r   r'  r'    s_     O&)& 5 5  = K K( r   r'  c                   |   a a ] tR tRt oRt]R 4       tV 3R lt]R 4       t	]R 4       t
]R 4       tR tR	tVtV ;t# )
Mapi	  z(Data accessor for the encoded map bytes.c                    \        V \        4      '       d   V P                  p \        V\        4      '       d   VP                  pW8  # rM   )r   r  
AsKeyBytesar.   s   &&r   CompareKeysMap.CompareKeys  s5    !S
,,a!S
,,a5Lr   c                   < \        V\        4      '       d   \        SV `  V4      # \	        V P
                  VP                  R 4      V P                  4      pVR8w  d   \        SV `  V4      # \        V4      h)r  r`   )	r   rf   r   r   rb   Keysr   rB  KeyError)r   r   ra   r   s   && r   r   Map.__getitem__  sb    #sW %%$))SZZ%8$:J:JKE{W ''
3-r   c                   \        \        V P                  RV P                  ,          V P                  )  4      pV P                  P	                  RV P                  ,          V P                  4      p\        W!\        P                  4      # )re   )r;   r   r   r   r   r'  r   r   )r   r    r:   s   &  r   rE  Map.Keys  sj    	499R$***d.>.>->?J ))

R$"2"22D4D4D
ECs11r   c                B    \        V P                  V P                  4      # rM   )r  r   r   r   s   &r   Values
Map.Values&  s    $))T--..r   c                    \        V P                  V P                  4       UUu/ uF  w  rVP                  VP                  bK  	  upp# u uppi rM   )ziprE  rM  r   )r   kvs   &  r   r   	Map.Value*  s:    ),TYY)DE)DAGGQWW)DEEEs   "A
c                >    R V P                   \        V 4      3,          # )zMap(%s, size=%d)r   r   s   &r   r   Map.__repr__.  r  r   r#   )r$   r%   r&   r'   r(   r)   rB  r   r   rE  rM  r   r   r*   r+   r   r   s   @@r   r=  r=  	  sg     0  2 2 / / F F7 7r   r=  c                     a  ] tR tRt o RtR)t]R 4       tR tR t	]
R 4       tR tR t]
R	 4       t]
R
 4       t]
R 4       tR t]
R 4       t]
R 4       t]
R 4       tR t]
R 4       t]
R 4       tR t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       tR t]
R 4       t ]
R 4       t!]
R 4       t"]
R 4       t#]
R 4       t$]
R  4       t%]
R! 4       t&]
R" 4       t']
R# 4       t(]
R$ 4       t)]
R% 4       t*]
R& 4       t+R't,V t-R(# )*r  i2  z)Data accessor for the encoded data bytes.c                H    \         P                  V4      w  r4\        WW44      # rM   )r   rn   r  )r:   parent_widthrm   r    rg   s   &&&  r   r  Ref.PackedType7  s     K0Js*44r   c                6    Wn         W n        W0n        W@n        R # rM   r   _parent_widthr   _type)r   r:   rX  r    rg   s   &&&&&r   r   Ref.__init__<  s    I%!Jr   c                l    R V P                   V P                  V P                  V P                  3,          # )z1Ref(%s, parent_width=%d, byte_width=%d, type_=%s)r[  r   s   &r   r   Ref.__repr__B  s5    >		

	B  r   c                4    V P                   R V P                   # rM   )r   r\  r   s   &r   _Bytes
Ref._BytesJ  s    99)t))**r   c                <    \        R V P                  : RV: 24      h)zcannot convert z to )r   r]  )r   target_types   &&r   _ConvertErrorRef._ConvertErrorN  s    
[I
JJr   c                N    V P                   P                  ^ V P                  4      # r   )r   r   r\  r   s   &r   	_IndirectRef._IndirectQ  s    99a!3!344r   c                :    V P                   \        P                  J # rM   )r]  r   r   r   s   &r   IsNull
Ref.IsNullT      ::""r   c                :    V P                   \        P                  J # rM   )r]  r   rr   r   s   &r   IsBool
Ref.IsBoolX  rn  r   c                    V P                   \        P                  J d$   \        \	        \
        V P                  4      4      # V P                  ^ 8g  # r   )r]  r   rr   r5  r;   r   rb  AsIntr   s   &r   AsBool
Ref.AsBool\  s6    zzTYY'!T[[)**ZZ1_r   c                    V P                   ;'       d5    \        \        V P                  WP                  \
        P                  4      # )zMutates underlying boolean value bytes in place.

Args:
  value: New boolean value.

Returns:
  Whether the value was mutated or not.
)rp  rG   r   r   r\  r   r   r   r   s   &&r   
MutateBoolRef.MutateBoolc  s8     ;;  7	499e// r   c                B    V P                   ;'       g    V P                  # rM   )IsIntIsFloatr   s   &r   	IsNumericRef.IsNumericp  s    ::%%%r   c                    V P                   \        P                  \        P                  \        P                  \        P
                  39   # rM   )r]  r   r}   r   r   r   r   s   &r   r{  	Ref.IsIntt  s8    ::			  r   c                   V P                   '       d   ^ # V P                  '       d   \        V P                  4      # V P                  \
        P                  J d   \        \        V P                  4      # V P                  \
        P                  J d,   \        \        V P                  4       RV P                   4      # V P                  \
        P                  J d   \        \        V P                  4      # V P                  \
        P                  J d,   \        \        V P                  4       RV P                   4      # V P                   '       d   \#        V P$                  4      # V P&                  '       d   \#        V P(                  4      # V P*                  '       d   \#        V P,                  4      # V P.                  '       d   \#        V P0                  4      # V P2                  '       d   \#        V P4                  4      # V P6                  '       d   \#        V P8                  4      # V P;                  \
        P                  4      h)z+Returns current reference as integer value.N)rl  rp  rf   rt  r]  r   r}   r;   r   rb  r   ri  r   r   r   r   IsStringr8   r8  IsKeyr7  IsBlobAsBlobIsVectorAsVectorrz   AsTypedVectorr   AsFixedTypedVectorrf  r   s   &r   rs  	Ref.AsInt}  s    {{{		txx	Q$$	t((	(Q();4+;+;<==zzTYYQ$$	t))	)Q();4+;+;<==		_						##$$		 	 	 (())txx((r   c           	        V P                   \        P                  J d:   \        \        V P
                  WP                  \        P	                  V4      4      # V P                   \        P                  J d>   \        \        V P                  4       WP                  \        P	                  V4      4      # V P                   \        P                  J d:   \        \        V P
                  WP                  \        P                  V4      4      # V P                   \        P                  J d>   \        \        V P                  4       WP                  \        P                  V4      4      # R# )zMutates underlying integer value bytes in place.

Args:
  value: New integer value. It must fit to the byte size of the existing
    encoded value.

Returns:
  Whether the value was mutated or not.
F)r]  r   r}   rG   r   r   r\  r   r   ri  r   r   r   r   rw  s   &&r   	MutateIntRef.MutateInt  s     zzTXXQ		5*<*<hjj>OPP	t((	(
T^^u&6&6

58I  
tyy	 Q		5*<*<hjj>OPP	t))	)
T^^u&6&6

58I  r   c                \    V P                   \        P                  \        P                  39   # rM   )r]  r   rq   r   r   s   &r   r|  Ref.IsFloat  s     ::$**d&9&9:::r   c                   V P                   '       d   R# V P                  '       d   \        V P                  4      # V P                  '       d   \        V P
                  4      # V P                  \        P                  J d   \        \        V P                  4      # V P                  \        P                  J d,   \        \        V P                  4       RV P                   4      # V P                  '       d   \        V P                   4      # V P"                  '       d   \        \%        V P&                  4      4      # V P)                  4       '       d   \        \%        V P*                  4      4      # V P-                  4       '       d   \        \%        V P.                  4      4      # V P1                  \        P                  4      h)z2Returns current reference as floating point value.g        N)rl  rp  floatrt  r{  rs  r]  r   rq   r;   r   rb  r   ri  r   r  r8  r  r8   r  rz   r  r   FixedTypedVectorrf  r   s   &r   AsFloatRef.AsFloat  s)    {{{	4;;	4::	tzz	!Q$$	t**	*Q();4+;+;<==	4==!!	3t}}%&&					3t))*++		 	 	"	"3t,,-..tzz**r   c           	        V P                   \        P                  J dE   \        \        V P
                  VV P                  \        P                  V P                  4      4      # V P                   \        P                  J dI   \        \        V P                  4       VV P                  \        P                  V P                  4      4      # R# )zMutates underlying floating point value bytes in place.

Args:
  value: New float value. It must fit to the byte size of the existing
    encoded value.

Returns:
  Whether the value was mutated or not.
F)r]  r   rq   rG   r   r   r\  r   r!   r   ri  r   rw  s   &&r   MutateFloatRef.MutateFloat  s     zzTZZ

))




**T''
(  
t**	*

..





**T%%
&  r   c                :    V P                   \        P                  J # rM   )r]  r   r   r   s   &r   r  	Ref.IsKey      ::!!r   c                    V P                   '       d/   \        V P                  4       V P                  4      P                  # V P                  \        P                  4      hrM   )r  r
  ri  r   r   rf  r   r   r   s   &r   r?  Ref.AsKeyBytes  s@    zzz!4#3#34:::txx((r   c                    V P                   '       d.   \        \        V P                  4       V P                  4      4      # V P                  \        P                  4      hrM   )r  strr
  ri  r   rf  r   r   r   s   &r   r7  	Ref.AsKey  s?    zzzT^^%t'7'7899txx((r   c                :    V P                   \        P                  J # rM   )r]  r   r~   r   s   &r   r  Ref.IsString  s    ::$$r   c                    V P                   '       d/   \        V P                  4       V P                  4      P                  # V P
                  '       d   V P                  # V P                  \        P                  4      hrM   )
r  r   ri  r   r   r  r?  rf  r   r~   r   s   &r   AsStringBytesRef.AsStringBytes  sS    }}}DNN$d&6&67===	__t{{++r   c                    V P                   '       d.   \        \        V P                  4       V P                  4      4      # V P
                  '       d   V P                  # V P                  \        P                  4      hrM   )
r  r  r   ri  r   r  r7  rf  r   r~   r   s   &r   r8  Ref.AsString  sR    }}}($*:*:;<<	ZZt{{++r   c                h    \        V P                  4       V P                  4      P                  V4      # rM   )r   ri  r   r   rw  s   &&r   MutateStringRef.MutateString  s'    $.."D$4$45<<UCCr   c                :    V P                   \        P                  J # rM   )r]  r   r   r   s   &r   r  
Ref.IsBlob  rn  r   c                    V P                   '       d/   \        V P                  4       V P                  4      P                  # V P                  \        P                  4      hrM   )r  r   ri  r   r   rf  r   r   r   s   &r   r  
Ref.AsBlob  s@    {{{$.."D$4$45;;;tyy))r   c                r    V P                   ;'       g%    V P                  ;'       g    V P                  4       # rM   )r  rz   r   r   s   &r   IsAnyVectorRef.IsAnyVector#  s+    ==KKD..KK$2I2I2KKr   c                \    V P                   \        P                  \        P                  39   # rM   )r]  r   r   r   r   s   &r   r  Ref.IsVector'  s    ::$++txx000r   c                    V P                   '       d%   \        V P                  4       V P                  4      # V P	                  \
        P                  4      hrM   )r  r  ri  r   rf  r   r   r   s   &r   r  Ref.AsVector+  s:    }}}DNN$d&6&677t{{++r   c                @    \         P                  V P                  4      # rM   )r   rz   r]  r   s   &r   rz   Ref.IsTypedVector2  s    djj))r   c                    V P                   '       dC   \        V P                  4       V P                  \        P                  V P                  4      4      # V P                  R 4      h)TYPED_VECTOR)rz   r'  ri  r   r   r   r]  rf  r   s   &r   r  Ref.AsTypedVector6  sS    
..





'
'


3  ~..r   c                @    \         P                  V P                  4      # rM   )r   r   r]  r   s   &r   r   Ref.IsFixedTypedVectorA  s    ""4::..r   c                    V P                   '       dG   \        P                  V P                  4      w  r\	        V P                  4       V P                  W4      # V P                  R 4      h)FIXED_TYPED_VECTOR)r   r   r   r]  r'  ri  r   rf  )r   r   r   s   &  r   r  Ref.AsFixedTypedVectorE  sS    ==djjIl)4+;+;\PP344r   c                :    V P                   \        P                  J # rM   )r]  r   r   r   s   &r   IsMap	Ref.IsMapM  r  r   c                    V P                   '       d%   \        V P                  4       V P                  4      # V P	                  \
        P                  4      hrM   )r  r=  ri  r   rf  r   r   r   s   &r   AsMap	Ref.AsMapQ  s:    zzz!4#3#344txx((r   c                   V P                   '       d   R# V P                  '       d   V P                  # V P                  '       d   V P                  # V P
                  '       d   V P                  # V P                  '       d   V P                  # V P                  '       d   V P                  # V P                  '       d   V P                  # V P                  '       d   V P                  P                  # V P                   '       d   V P"                  P                  # V P$                  '       d   V P&                  P                  # V P(                  '       d   V P*                  P                  # \-        RV ,          4      h)zConverts current reference to value of corresponding type.

This is equivalent to calling `AsInt` for integer values, `AsFloat` for
floating point values, etc.

Returns:
  Value of corresponding type.
Nzcannot convert %r to value)rl  rp  rt  r{  rs  r|  r  r  r8  r  r7  r  r  r  r  r   r  r  rz   r  r   r  r   r   s   &r   r   	Ref.ValueX  s    {{{	[[	ZZ	\\	]]	ZZ	[[	ZZ	]]   				%%%		 	 	 $$***2T9::r   )r   r   r\  r]  Nr[  ).r$   r%   r&   r'   r(   r   r)   r  r   r   r   rb  rf  ri  rl  rp  rt  rx  r}  r{  rs  r  r|  r  r  r  r?  r7  r  r  r8  r  r  r  r  r  r  rz   r  r   r  r  r  r   r*   r+   r,   s   @r   r  r  2  sg    1=)5 5 + +K5 # # # #   & &   ) ):2 ; ; + +.: " " ) ) ) ) % % , , , ,D # # * * L L 1 1 , , * * / / / / 5 5 " " ) )  ;  ;r   r  c                 B     \        V 4       R #   \         d     R# i ; i)TF)iterr   )objs   &r   _IsIterabler  |  s#    I	 s    c                     a  ] tR tRt o Rt]R 4       t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tR	 t]R
 4       t]R 4       t]R 4       t]P$                  3R ltRR lt]P$                  3R ltR tR tRtV tR# )r   i  z;Class to represent given value during the encoding process.c                 T    \        ^ \        P                  \        P                  4      # r   )r   r   r   r   r   r#   r   r   Null
Value.Null  s    DIIx{{++r   c                T    \        V \        P                  \        P                  4      # rM   )r   r   rr   r   r   r   s   &r   Bool
Value.Bool  s    		8;;//r   c                8    \        V \        P                  V4      # rM   )r   r   r}   r   rh   s   &&r   Int	Value.Int  s    ),,r   c                8    \        V \        P                  V4      # rM   )r   r   r   r  s   &&r   UInt
Value.UInt  s    		9--r   c                8    \        V \        P                  V4      # rM   )r   r   rq   r  s   &&r   FloatValue.Float  s    

I..r   c                T    \        V \        P                  \        P                  4      # rM   )r   r   r   r   r   )rS   s   &r   r
  	Value.Key  s    8;;//r   c                *    Wn         W n        W0n        R # rM   _valuer]  _min_bit_width)r   r   rg   min_bit_widths   &&&&r   r   Value.__init__  s    KJ (r   c                    V P                   # rM   )r  r   s   &r   r   Value.Value  s    ;;r   c                    V P                   # rM   )r]  r   s   &r   r   
Value.Type  s    ::r   c                    V P                   # rM   )r  r   s   &r   MinBitWidthValue.MinBitWidth  s    r   c                `    \         P                  V P                  V P                  V4      4      # rM   )r   ri   r]  StoredWidthr   parent_bit_widths   &&r   StoredPackedTypeValue.StoredPackedType  s#    99TZZ!1!12B!CDDr   c                8   \         P                  V P                  4      '       d   V P                  # R FY  pV\	        W4      ,           W#,          ,           p\
        P                  W@P                  ,
          4      pV^V,          8X  g   KW  Vu # 	  \        R4      h)r   zrelative offset is too big)r   re         )	r   rt   r]  r  rK   r   r   r  r   )r   rI   
elem_indexr    
offset_locrh   s   &&&   r   	ElemWidthValue.ElemWidth  s    }}TZZ      

(/0#$ 
 **Z++56i	Y	' ! 1
22r   c                    \         P                  V P                  4      '       d   \        V P                  V4      # V P                  # rM   )r   rt   r]  maxr  r  s   &&r   r  Value.StoredWidth  s5    }}TZZ  $$&677r   c                \    R V P                   : RV P                  : RV P                  : R2# )zValue(z, )r  r   s   &r   r   Value.__repr__  s    "&++tzz4;N;NOOr   c                ,    \        V P                  4      # rM   )r  r  r   s   &r   r  Value.__str__  s    t{{r   )r  r]  r  Nr   )r$   r%   r&   r'   r(   r)   r  r  r  r  r  r
  r   r   r   r   r  r   r   r  r  r  r   r  r*   r+   r,   s   @r   r   r     s     C, , 0 0 - - . . / / 0 0(       /7kk E3 *2 
P r   r   c                    a  V 3R  lpV# )c                    < \        V^ ,          \        4      '       d.   V P                  V^ ,          4       S! V .VR,          O5/ VB  R# S! V .VO5/ VB  R# )r   :r   NNN)r   r  r
  )r   argskwargsfuncs   &*,r   wrapperInMap.<locals>.wrapper  sL    $q'3
hhtAw
4%$r(%f%
4!$!&!r   r#   r  r  s   f r   InMapr    s    " 
.r   c                    a  V 3R  lpV# )c                    < \        V4      ^8X  d   S! W^ ,          4       R# \        V4      ^8X  d*   V P                  V^ ,          4       S! W^,          4       R# \        R4      h)r   zinvalid number of argumentsN)r8   r
  r   )r   r  r  s   &*r   r  InMapForString.<locals>.wrapper  sM    
4yA~
4a	Ta
hhtAw
4a455r   r#   r  s   f r   InMapForStringr    s    6 
.r   c                   F   a  ] tR tRt o RtR tR tR t]R 4       t	Rt
V tR# )	Pooli  zCCollection of (data, offset) pairs sorted by data for quick access.c                    . V n         R # rM   _poolr   s   &r   r   Pool.__init__  	    DJr   c                    W3p\        V P                  VR  4      pVR8w  d   V P                  V,          w  rRV# V P                  P                  WC4       R# )c                 (    V ^ ,          V^ ,          8  # r   r#   r@  s   &&r   r^   #Pool.FindOrInsert.<locals>.<lambda>  s    qtad{r   Nr`   )rb   r  insert)r   datarS   dora   _s   &&&   r   FindOrInsertPool.FindOrInsert  sM    	B$**b*BCE{**U#iamJJe r   c                    . V n         R # rM   r  r   s   &r   Clear
Pool.Clear  r  r   c                N    V P                    UUu. uF  w  rVNK	  	  upp# u uppi rM   r  )r   r  r  s   &  r   ElementsPool.Elements  s      $

+
WTD
+++s   !r  N)r$   r%   r&   r'   r(   r   r  r  r   r!  r*   r+   r,   s   @r   r  r    s+     K , ,r   r  c                   v  a  ] tR tRt o RtRR]P                  3R ltR t]	R 4       t
]	R 4       tR	 tR
 tR tR tR tR tR tR tR tR tR1R ltR t]R 4       t]R 4       tR tR1R lt]R 4       t]R2R l4       t]R2R l4       t ]R2R l4       t!]R2R l4       t"]R2R l4       t#]R2R  l4       t$R! t%R" t&]'PP                  R1R# l4       t)]R$ 4       t*]'PP                  R1R% l4       t+]R1R& l4       t,]R3R' l4       t-R( t.R) t/]'PP                  R1R* l4       t0R+ t1R, t2]R- 4       t3]	R. 4       t4]R/ 4       t5R0t6V t7R# )4r   i  z?Helper class to encode structural data into flexbuffers format.FTc                    Wn         W n        W0n        \        4       V n        \        4       V n        R V n        \        4       V n        . V n	        R# FN)
_share_strings_share_keys_force_min_bit_widthr  _string_pool	_key_pool	_finishedr   r   _stack)r   share_strings
share_keysforce_min_bit_widths   &&&&r   r   Builder.__init__  s@     (! 3DVDNDNDIDKr   c                ,    \        V P                  4      # rM   )r8   r   r   s   &r   r   Builder.__len__  s    tyy>r   c                    V P                   # rM   )r)  r   s   &r   
StringPoolBuilder.StringPool  s    r   c                    V P                   # rM   )r*  r   s   &r   KeyPoolBuilder.KeyPool  s    >>r   c                    V P                   P                  4        V P                  P                  4        R V n        \	        4       V n        . V n        R# r%  )r)  r  r*  r+  r   r   r,  r   s   &r   r  Builder.Clear"  s;    NNDNDIDKr   c                   V P                   '       d   \        R4      h\        V P                  4      ^8w  d   \        R4      hV P                  ^ ,          pV P	                  VP                  \        V P                  4      4      4      pV P                  WR7       V P                  \        VP                  4       ^R7       V P                  \        V^R7       RV n        V P                  # )z8Finishes encoding process and returns underlying buffer.z!builder has been already finishedzinternal stack size must be oner   T)r+  RuntimeErrorr8   r,  _Alignr  r   	_WriteAny_Writer   r  finished)r   r   r    s   &  r   FinishBuilder.Finish)  s    ~~~<== 4;;1:;;KKNEU__S^<=JNN5N0KK5))+K:KK:!K,DM99r   c                H    V P                   VR  pVR VP                  ^ 4       # rM   )r   r   )r   rS   r   s   && r   _ReadKeyBuilder._ReadKey>  s'    
))FG
C}!r   c                    ^V,          pV P                   P                  R\        \        V P                   4      V4      ,          4       V# )r       )r   extendrK   r8   )r   	alignmentr    s   && r   r=  Builder._AlignB  s7    iJIIW}S^ZHHIr   c                P    V P                   P                  \        WV4      4       R # rM   )r   rH  rA   )r   r9   r   r    s   &&&&r   r?  Builder._WriteG  s    IIU3z23r   c                P    V P                   P                  \        WV4      4       R # rM   )r   rH  rD   )r   r9   rC   r    s   &&&&r   _WriteVectorBuilder._WriteVectorJ  s    II[j9:r   c                    \        V P                  4      V,
          pV^8X  g   V^^V,          ,          8  g   Q hV P                  \        W24       R# )r  N)r8   r   r?  r   )r   rS   r    relative_offsets   &&& r   _WriteOffsetBuilder._WriteOffsetM  s?    $))nv-O?oq:~1FGGGKK?/r   c           
        \         P                  \        \         P                  \        \         P                  \
        \         P                  \        \         P                  \        /P                  VP                   4      pV'       d   V P                  W1P                  V4       R # V P                  VP                  V4       R # rM   )r   r   r   rr   r}   r   r   rq   r   getr?  r   rR  )r   r   r    r9   s   &&& r   r>  Builder._WriteAnyR  ss    		1		1!		1

A 
c%**o  
kk#{{J/
Z0r   c                   \         P                  \        V4      4      pV P                  V4      pV P	                  \        \        V4      V4       \        V P
                  4      pV P
                  P                  V4       V'       d   V P
                  P                  ^ 4       V P                  P                  \        WcV4      4       V# r   )
r   r   r8   r=  r?  r   rH  appendr,  r   )r   r  append_zerorg   rh   r    locs   &&&&   r   
_WriteBlobBuilder._WriteBlob_  s    

3t9%IY'JKK3t9j)
dii.CIIT
iiqKKuS34Jr   c                   \         P                  V4      p\         P                  \        V4      4      V8  d   \	        R4      hV P                  V4       V'       g!   V P                  \        \        V4      V4       \        V P                  4      p\        P                  \        \        P                  \        \        P                  \        /P                  V4      pV'       g   \        R4      hV P!                  WsV4       \        P#                  Y'       d   \        V4      M^ 4      pV P$                  P'                  \)        WhV4      4       V# )z7Writes scalar vector elements to the underlying buffer.z*too many elements for the given byte_widthzunsupported element_type)r   r!   r   r8   r   r=  r?  r   r   r}   r   r   rq   r   rU  r   rN  r   r,  rX  r   )	r   r   r    elementsfixedrh   rZ  r9   rg   s	   &&&&&    r   _WriteScalarVectorBuilder._WriteScalarVectorj  s    

:&I zz#h- 9,CDDKK	
kk!S]J/
dii.C88Q		1djj!
4
8
8
FC011cZ0|eS]KEKKuS34Jr   Nc           	     $   \        V4      pV'       d   V'       g   \        R4      h\        V P                  \        P                  V4      4      p^pV'       d7   \        WdP                  \        V P                  4      4      4      pV^,          p\        P                  p\        V4       Fs  w  r\        WjP                  \        V P                  4      Wy,           4      4      pV'       g   KC  V	^ 8X  d   V
P                  pKX  WP                  8w  g   Kj  \        R4      h	  V'       d'   \        P                  V4      '       g   \        R4      hV P                  V4      pV'       dE   V P                  VP                  V4       V P!                  \
        ^VP"                  ,          V4       V'       g   V P!                  \
        W[4       \        V P                  4      pV F  p
V P%                  W4       K  	  V'       g4   V F-  p
V P                  P'                  V
P)                  V4      4       K/  	  V'       d   \        P*                  pM8V'       d!   \        P-                  Y'       d   TM^ 4      pM\        P.                  p\        WV4      # )z0Writes vector elements to the underlying buffer.zfixed vector must be typedz.typed vector elements must be of the same typer   )r8   r   r  r(  r   r   r  r   r   r   	enumerater<  r   r=  rR  r   r?  r  r>  rX  r  r   r   r   )r   r^  typedr_  keysr>   rh   prefix_elemsvector_typer0   r"  r    rZ  rg   s   &&&&&         r   _CreateVectorBuilder._CreateVector  s   ]FU344 D--xzz&/ABILiDII!?@ial((K(#iS^\=M!NOi	6+FF"OPP $ T77DDBCCY'J


J/
kk!Q$***J7
kk!V( dii.C
nnQ#  !		++I67  hhe	"";%QGY''r   c                J   V P                  V4      p\        V P                  4      p\        P                  \
        \        P                  \        \        P                  \        /V,          pV P                  WaV4       V P                  P                  \        WRV4      4       R # rM   )r=  r8   r   r   r   r   r   r   r   r   r?  r,  rX  r   )r   r   rg   rh   r    rZ  r9   s   &&&&   r   _PushIndirectBuilder._PushIndirect  sr    Y'J
dii.Ca!3!3Q8K8KQ
OC 	KKJ'KKuS34r   c                J   \        V P                  4      pVP                  R4      pV P                  VR\        P
                  R7      pV P                  '       dI   V P                  P                  W44      pVe*   V P                  VR1 T;V P                  R,          n
        pV# )zEncodes string value.r   TrY  rg   Nr`   )r8   r   r   r[  r   r~   r&  r)  r  r,  r  )r   r   reset_tor   rZ  prev_locs   &&    r   r   Builder.String  s     499~Hll7#G
//'t4;;/
GC""//=h		IIhi '//BJr   c                F    V P                  VR\        P                  R7      # )zEncodes binary blob value.

Args:
  value: A byte/bytearray value to encode

Returns:
  Offset of the encoded value in underlying the byte buffer.
Frn  )r[  r   r   rw  s   &&r   r   Builder.Blob  s     ??5e499?EEr   c                    \        V\        \        34      '       d   TpMVP                  R4      p^ V9   d   \	        R4      h\        V P                  4      pV P                  P                  V4       V P                  P                  ^ 4       V P                  '       d1   V P                  P                  W#4      pVe   V P                  VR1 TpV P                  P                  \        P                  V4      4       V# )zEncodes key value.

Args:
  value: A byte/bytearray/str value to encode. Byte object must not contain
    zero bytes. String object must be convertible to ASCII.

Returns:
  Offset of the encoded value in the underlying byte buffer.
r  zkey contains zero byteN)r   bytesr   r   r   r8   r   rH  rX  r'  r*  r  r,  r   r
  )r   r   r   rZ  rp  s   &&   r   r
  Builder.Key  s     %%+,,gW%gG|/00
dii.CIIWIIQ,,W:h		IIcdOKKuyy~&Jr   c                    V'       d   V P                  V4       V P                  P                  \        P	                  4       4       R# )zEncodes None value.N)r
  r,  rX  r   r  r   s   &&r   r  Builder.Null  s(    

hhsmKKuzz|$r   c                b    V P                   P                  \        P                  V4      4       R# )z8Encodes boolean value.

Args:
  value: A boolean value.
N)r,  rX  r   r  rw  s   &&r   r  Builder.Bool  s     	KKuzz%()r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  P	                  \
        P                  W4      4       R# )z{Encodes signed integer value.

Args:
  value: A signed integer value.
  byte_width: Number of bytes to use: 1, 2, 4, or 8.
N)r   r   r!   r,  rX  r   r  r   r   r    rh   s   &&& r   r  Builder.Int  s>     &01_

5!(**Z:PIKKuyy23r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  V\        P
                  V4       R# )zEncodes signed integer value indirectly.

Args:
  value: A signed integer value.
  byte_width: Number of bytes to use: 1, 2, 4, or 8.
N)r   r   r!   rk  r   r   r|  s   &&& r   IndirectIntBuilder.IndirectInt  s;     &01_

5!(**Z:PIud//;r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  P	                  \
        P                  W4      4       R# )zEncodes unsigned integer value.

Args:
  value: An unsigned integer value.
  byte_width: Number of bytes to use: 1, 2, 4, or 8.
N)r   r   r!   r,  rX  r   r  r|  s   &&& r   r  Builder.UInt"  s>     &01_

5!(**Z:PIKKuzz%34r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  V\        P
                  V4       R# )zEncodes unsigned integer value indirectly.

Args:
  value: An unsigned integer value.
  byte_width: Number of bytes to use: 1, 2, 4, or 8.
N)r   r   r!   rk  r   r   r|  s   &&& r   IndirectUIntBuilder.IndirectUInt-  s;     &01_

5!(**Z:PIud00)<r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  P	                  \
        P                  W4      4       R# )ztEncodes floating point value.

Args:
  value: A floating point value.
  byte_width: Number of bytes to use: 4 or 8.
N)r   r   r!   r,  rX  r   r  r|  s   &&& r   r  Builder.Float8  s>     &01_

5!(**Z:PIKKu{{545r   c                    V^ 8X  d   \         P                  V4      M\         P                  V4      pV P                  V\        P
                  V4       R# )zEncodes floating point value indirectly.

Args:
  value: A floating point value.
  byte_width: Number of bytes to use: 4 or 8.
N)r   r   r!   rk  r   r   r|  s   &&& r   IndirectFloatBuilder.IndirectFloatC  s;     &01_

5!(**Z:PIud119=r   c                ,    \        V P                  4      # )zStarts vector construction.r8   r,  r   s   &r   _StartVectorBuilder._StartVectorN      t{{r   c                    V P                  V P                  VR W#4      pV P                  VR1 V P                  P                  V4       VP                  # )z6Finishes vector construction by encodung its elements.N)rh  r,  rX  r   )r   rN   rd  r_  vecs   &&&& r   
_EndVectorBuilder._EndVectorR  sI    


T[[0%
?CEFKKs99r   c              #     "   V'       d   V P                  V4        V P                  4       pV x  V P                  VR R R7       R#   T P                  XR R R7       i ; i5i)Frd  r_  Nr
  r  r  r   r   rN   s   && r   r  Builder.VectorY  sO     

hhsm7!ej
ooe5o6dooe5o6   A A A AA c                    V P                  4       ;_uu_ 4        V F  pV P                  V4       K  	  RRR4       R#   + '       g   i     R# ; i)zvEncodes sequence of any elements as a vector.

Args:
  elements: sequence of elements, they may have different types.
N)r  Add)r   r^  r"  s   && r   VectorFromElementsBuilder.VectorFromElementsd  s0     
!  
s	   >A	c              #     "   V'       d   V P                  V4        V P                  4       pV x  V P                  VR RR7       R#   T P                  XR RR7       i ; i5i)TFr  Nr  r  s   && r   r'  Builder.TypedVectoro  sO     

hhsm6!ej
ooe4uo5dooe4uo5r  c                &   \        V\        P                  4      '       Ed	   VP                  R8X  d&   V P                  \        P
                  ^VRR7       R# VP                  R8X  d&   V P                  \        P
                  ^VRR7       R# VP                  R9   d0   V P                  \        P                  VP                  VRR7       R# VP                  R9   d0   V P                  \        P                  VP                  VRR7       R# \        RVP                  ,          4      hVf   V P                  MV P                  V4      pV P                  4       ;_uu_ 4        V F  pV! V4       K  	  RRR4       R#   + '       g   i     R# ; i)	a  Encodes sequence of elements of the same type as typed vector.

Args:
  elements: Sequence of elements, they must be of the same type.
  element_type: Suggested element type. Setting it to None means determining
    correct value automatically based on the given elements.
r4   Fr_  r5   zunsupported array typecode: %sN)r.   r/   r0   lr1   )r!   r2   r   Lr3   )r   arraytypecoder`  r   rq   r}   itemsizer   r   r  Adderr'  )r   r^  r   addr"  s   &&&  r   TypedVectorFromElementsBuilder.TypedVectorFromElementsz  s4    (EKK((			c	!

AxuE#

AxuE 99HHh'' 	  	
  99IIx(((% 	  	
 9H<M<MMNN$,DHH$**\2JcA
a&  s   #E??F	c                  a ^\        V4      u;8:  d   ^8:  g   M \        R4      hV Uu0 uF  p\        V4      kK  	  pp\        V4      ^8w  d   \        R4      hVw  pVfT   \        \
        P                  \        \
        P                  /P                  V4      pV'       g   \        RV,          4      hV^ 8X  d   \
        P                  \        P                  \
        P                  \        P                  \
        P                  \        P                  /V,          o^\        V3R lV 4       4      ,          pV P!                  W#VRR7       R# u upi )ae  Encodes sequence of elements of the same type as fixed typed vector.

Args:
  elements: Sequence of elements, they must be of the same type. Allowed
    types are `Type.INT`, `Type.UINT`, `Type.FLOAT`. Allowed number of
    elements are 2, 3, or 4.
  element_type: Suggested element type. Setting it to None means determining
    correct value automatically based on the given elements.
  byte_width: Number of bytes to use per element. For `Type.INT` and
    `Type.UINT`: 1, 2, 4, or 8. For `Type.FLOAT`: 4 or 8. Setting it to 0
    means determining correct value automatically based on the given
    elements.
z&only 2, 3, or 4 elements are supportedz%all elements must be of the same typeNr4  c              3   4   <"   T F  pS! V4      x  K  	  R # 5irM   r#   ).0r"  widths   & r   	<genexpr>7Builder.FixedTypedVectorFromElements.<locals>.<genexpr>  s     7hE!HHhs   Tr  )r8   r   typer   rf   r   r}   r  rq   rU  r   r   r   r   r   r  r`  )r   r^  r   r    r"  typesrg   r  s   &&&&   @r   FixedTypedVectorFromElements$Builder.FixedTypedVectorFromElements  s   " H""?@@&'hT!WhE'
5zQ=>>HU488UDJJ7;;EBl6>??Q
))XZZ
((HJJ
**hjj 		e
 7h777jLhdK' (s   Ec                ,    \        V P                  4      # )zStarts map construction.r  r   s   &r   	_StartMapBuilder._StartMap  r  r   c                  a  S P                   VR p\        V4      ^,          ^ 8w  d   \        R4      hVR,           FA  pVP                  \        P                  Jg   K#  \        R\        P                  ,          4      h	  \        VR,          VR,          4      p\        VV 3R lR7      pS P                   VR1 V F  pS P                   P                  V4       K   	  S P                  S P                   VR^1,          RR	R
7      pS P                  S P                   V^,           R^1,          R	R	VR7      pS P                   VR1 S P                   P                  V4       VP                  # )z3Finishes map construction by encodung its elements.Nz&must be even number of keys and values:NNre   zall map keys must be of %s type:r   Nre   c                 H   < SP                  V ^ ,          P                  4      # r   )rD  r   )pairr   s   &r   r^   !Builder._EndMap.<locals>.<lambda>  s    4==a+Gr   )r   TFr  )rd  r_  re  )r,  r8   r<  r   r   rP  sortedrH  rh  rX  r   )r   rN   stackr   pairsr  re  rC   s   f&      r   _EndMapBuilder._EndMap  s8    KKE
5zA~ABBSzz		!<txxGHH  c
E$K(E5GHEEF
kk  dkk%((34uMDEAINN#5D   F 	EFKKv<<r   c              #     "   V'       d   V P                  V4        V P                  4       pV x  V P                  V4       R #   T P                  X4       i ; i5irM   )r
  r  r  r  s   && r   r=  Builder.Map  sA     

hhsmnnej
ll5dll5s   AA AAAc                    V P                  4       pVP                  4        F'  w  r4V P                  V4       V P                  V4       K)  	  V P	                  V4       R # rM   )r  itemsr
  r  r  )r   r^  rN   rQ  rR  s   &&   r   MapFromElementsBuilder.MapFromElements  sE    NNE 
hhqk
hhqk ! 	LLr   c                   \         P                  V P                  \         P                  V P                  \         P
                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                   \         P"                  V P$                  \         P&                  V P(                  /
V,          # rM   )r   rr   r  r}   r  r   r  r   r  r   r  rq   r  r   r  r   r
  r   r   r~   r   )r   rg   s   &&r   r  Builder.Adder  s    		499$((4++		499D--

DJJT//$((		499T[[  r   c                   Vf   V P                  4        R# \        V\        4      '       d   V P                  V4       R# \        V\        4      '       d   V P                  V4       R# \        V\        4      '       d   V P                  V4       R# \        V\        4      '       d   V P                  V4       R# \        V\        \        34      '       d   V P                  V4       R# \        V\        4      '       d_   V P                  4       ;_uu_ 4        VP                  4        F'  w  r#V P!                  V4       V P#                  V4       K)  	  RRR4       R# \        V\$        P$                  4      '       d   V P'                  V4       R# \)        V4      '       d   V P+                  V4       R# \-        R\/        V4      ,          4      h  + '       g   i     R# ; i)z$Encodes value of any supported type.Nzunsupported python type: %s)r  r   r5  r  rf   r  r  r  r  r   ru  r   r   dictr=  r  r
  r  r  r  r  r  r   r  )r   r   rQ  rR  s   &&  r   r  Builder.Add  s3    }
iik	E4	 	 
ii	E3		
hhuo	E5	!	!
jj	E3		
kk%	EE9-	.	.
ii	E4	 	 88::KKMDA
((1+
((1+ " : 
E5;;	'	'
""5)	U		
e$3d5kABB ::s   <GG!	c                (    V P                   R,          # )r   r`   )r,  r   s   &r   	LastValueBuilder.LastValue  s    ;;r?r   c                <    V P                   P                  V4       R # rM   )r,  rX  rw  s   &&r   
ReuseValueBuilder.ReuseValue   s    KKur   )	r   r+  r(  r*  r'  r&  r,  r)  r@  rM   r   )Nr   )8r$   r%   r&   r'   r(   r   r   r   r   r   r4  r7  r  rA  rD  r=  r?  rN  rR  r>  r[  r`  rh  rk  r  r   r  r   r
  r  r  r  r  r  r  r  r  r  r  
contextlibcontextmanagerr  r  r'  r  r  r  r  r=  r  r  r  r  r  r*   r+   r,   s   @r   r   r     s/    G "++	"    *
4;0
1	08(t5   		F 		F<% 	* 	* 	4 	4 	< 	< 	5 	5 	= 	= 	6 	6 	> 	> 7 7 	 	 6 6 	 	: 	&L 	&LP8   C C4   	 	r   c                    \        V 4      ^8  d   \        R4      hV R,          p\        P                  \	        V ^V,           ) 4      WR,          R7      # )z/Returns root `Ref` object for the given buffer.zbuffer is too smallrl   r`   rI  )r8   r   r  r  r   )r:   r    s   & r   GetRootr  %  sO    X\
*
++2w*		#Z !:r7 
 
 r   c                X    \        4       pVP                  V 4       VP                  4       # )z1Returns bytearray with the encoded python object.)r   r  rA  )r  fbbs   & r   Dumpsr  /  s     	#''#,	r   c                ,    \        V 4      P                  # )z.Returns python object decoded from the buffer.)r  r   )r:   s   &r   Loadsr  6  s    			r   )r   r   r  r  r  )(r(   r  r  enumr   __all__IntEnumr   r   r   r   r;   r?   rA   rD   rG   rK   rT   rZ   rb   r   r   r   r   r   r   r
  r  r'  r=  r  r  r   r  r  r  r   r  r  r  r#   r   r   <module>r     sp      
:6t|| 6r QQQ$QQQ$Q6A
5H'
$$ '9 v@4<< v@r%O %OP F (
85 
8!:U !:H7& 7.U 8?% ?D&7& &7RG; G;T
M M`
, ,._ _Dr   