8fPdZddlmZddlZddlZeedr/ddlmZ ddlm Z n#e $r ddlm Z YnwxYwdZ Gd d Z n d Z dd lmZ d ZddlmZmZmZmZmZddlmZmZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#e$e%fdZ&dZ'dZ(dZ)idde)e!fddde!fddde!fddd e"fd!dd"e"fd#dd$e"fd%d&d'd(d)de)fd*d+d,d-d.d/d0d1d2d3d4d5d6d7d8dd9e"fdd:e"fdd;e"fdd?e"fde)e fdde fdde fddefddefddefddefd@ Z*GdAdBZ+GdCdDZ,dS)Ez.Fallback pure Python implementation of msgpack)datetimeNpypy_version_info) newlist_hint) BytesBuilder) StringBuilderTc"eZdZddZdZdZdS)StringIOc|r=tt||_|j|dSt|_dSN)rlenbuilderappendselfss |/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/msgpack/fallback.py__init__zStringIO.__init__sJ /,SVV44  ##A&&&&&, r ct|tr|}n$t|trt |}|j|dSr ) isinstance memoryviewtobytes bytearraybytesrrrs rwritezStringIO.writes\!Z(( IIKKAy)) !HH L   " " " " "r c4|jSr )rbuildrs rgetvaluezStringIO.getvalue!s<%%'' 'r N)r )__name__ __module__ __qualname__rrrr rr r sF / / / / # # # ( ( ( ( (r r F)BytesIOcgSr r#)sizes rr'(sr ) BufferFull OutOfData ExtraData FormatError StackError)ExtType TimestampicP|||ur |||vS|||uSr r#)objttypetuples r_check_type_strictr9?s9 tAww%tCyyA~tCyyA~r cXt|}|jdkrtd|S)Nr(z$cannot unpack from multi-byte object)ritemsize ValueError)r5views r_get_data_from_bufferr>Fs. c??D }?@@@ Kr c Xtddt|i|}|| |}n-#t$rt dt $rtwxYw|r"t|| |S)aw Unpack an object from `packed`. Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``ValueError`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. Other exceptions can be raised during unpacking. See :class:`Unpacker` for options. Nmax_buffer_sizezUnpack failed: incomplete inputr ) Unpackerr feed_unpackr*r<RecursionErrorr-_got_extradatar+_get_extradata)packedkwargsunpackerrets runpackbrKMsDDc&kkDVDDH MM&   <<<:;;;   8X4466777 Js A*A1>H>IBbz>Hbz>Ib)r2z>f)z>d)r0rO)r2rQ)rXz>Q)r(b)r0z>h)r2z>i)rXz>qb1sb2sb4srXb8sb16s) ceZdZdZdddddddddddedddddfdZd Zd Zd Zd Z d Z ddZ ddZ dZ efdZdZdZeZdZdZdZdZdZdS)rAa Streaming unpacker. Arguments: :param file_like: File-like object having `.read(n)` method. If specified, unpacker reads serialized data from it and `.feed()` is not usable. :param int read_size: Used as `file_like.read(read_size)`. (default: `min(16*1024, max_buffer_size)`) :param bool use_list: If true, unpack msgpack array to Python list. Otherwise, unpack to Python tuple. (default: True) :param bool raw: If true, unpack msgpack raw to Python bytes. Otherwise, unpack to Python str by decoding with UTF-8 encoding (default). :param int timestamp: Control how timestamp type is unpacked: 0 - Timestamp 1 - float (Seconds from the EPOCH) 2 - int (Nanoseconds from the EPOCH) 3 - datetime.datetime (UTC). :param bool strict_map_key: If true (default), only str or bytes are accepted for map (dict) keys. :param object_hook: When specified, it should be callable. Unpacker calls it with a dict argument after unpacking msgpack map. (See also simplejson) :param object_pairs_hook: When specified, it should be callable. Unpacker calls it with a list of key-value pairs after unpacking msgpack map. (See also simplejson) :param str unicode_errors: The error handler for decoding unicode. (default: 'strict') This option should be used only when you have msgpack data which contains invalid UTF-8 string. :param int max_buffer_size: Limits size of data waiting unpacked. 0 means 2**32-1. The default value is 100*1024*1024 (100MiB). Raises `BufferFull` exception when it is insufficient. You should set this parameter when unpacking data from untrusted source. :param int max_str_len: Deprecated, use *max_buffer_size* instead. Limits max length of str. (default: max_buffer_size) :param int max_bin_len: Deprecated, use *max_buffer_size* instead. Limits max length of bin. (default: max_buffer_size) :param int max_array_len: Limits max length of array. (default: max_buffer_size) :param int max_map_len: Limits max length of map. (default: max_buffer_size//2) :param int max_ext_len: Deprecated, use *max_buffer_size* instead. Limits max size of ext type. (default: max_buffer_size) Example of streaming deserialize from file-like object:: unpacker = Unpacker(file_like) for o in unpacker: process(o) Example of streaming deserialize from socket:: unpacker = Unpacker() while True: buf = sock.recv(1024**2) if not buf: break unpacker.feed(buf) for o in unpacker: process(o) Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``OutOfData`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. Other exceptions can be raised during unpacking. NrTFi@c| d} |d|_n1t|jstd||_d|_t |_d|_d|_| sd} | dkr| } |dkr| }|dkr| }|dkr| dz}|dkr| }| |_ ||j krtd |pt|j d |_ t||_t||_| |_||_d|cxkrd ksntd ||_| |_||_||_| |_| |_||_||_||_||_d|_| t| std |t|std|t|std||tdt| stddS)NstrictTz!`file_like.read` must be callableFrirur0z.read_size must be smaller than max_buffer_sizei@r1ztimestamp must be 0..3z`list_hook` is not callablez`object_hook` is not callablez#`object_pairs_hook` is not callablez8object_pairs_hook and object_hook are mutually exclusivez`ext_hook` is not callable)_feedingcallableread TypeError file_liker_buffer_buff_i_buf_checkpoint_max_buffer_sizer<min _read_sizebool_raw_strict_map_key_unicode_errors _use_list _timestamp _list_hook _object_hook_object_pairs_hook _ext_hook _max_str_len _max_bin_len_max_array_len _max_map_len _max_ext_len_stream_offset)rr| read_sizeuse_listraw timestampstrict_map_key object_hookobject_pairs_hook list_hookunicode_errorsr@ext_hook max_str_len max_bin_len max_array_len max_map_len max_ext_lens rrzUnpacker.__init__sf(  !%N   DMMIN++ E CDDD&DN!DM!{{   ! ('O "  )K "  )K B  +M "  )Q.K "  )K / t, , ,MNN N#Ls4+@)'L'LII #N33-!Y####!####566 6##'"3!''+''  ))<)< 9:: :  "8K+@+@ ";<< <  (:K1L1L (ABB B  "'8'DVWW W!! :899 9 : :r cN|jsJt|}t|j|jz t|z|jkrt |jdkr+|jd|j=|xj|jzc_d|_|j|dSNr) rxr>r r}r~rr)rextend)r next_bytesr=s rrBz Unpacker.feedBs}}$Z00 t|  t| +c$ii 7$:O O O   ! # # 3t334 LLD0 0LL#$D  D!!!!!r cX|xj|j|jz z c_|j|_dS)z)Gets rid of the used parts of the buffer.N)rr~rrs r_consumezUnpacker._consumeQs0 t|d.BBB#|r c<|jt|jkSr )r~r r}rs rrEzUnpacker._got_extradataVs|c$,////r c*|j|jdSr )r}r~rs rrFzUnpacker._get_extradataYs|DLNN++r c\||d}||S)NFraise_outofdata)_readrrnrJs r read_byteszUnpacker.read_bytes\s)jjEj22  r c||||j}|j|||z}|t|z|_|S)Nr)_reserver~r}r )rrrirJs rrzUnpacker._readasI a 999 Ll1q1u9%3s88|  r ct|j|jz |z }|dkrdS|jr|j|_t |jdkr+|jd|j=|xj|jzc_d|_| }|t|jz|jkrt|dkrqt|j |}|j |}|sn?t|tsJ|xj|z c_|t|z}|dkqt|j||jzkr|rd|_t dSdSr)r r}r~rxrr*rr)maxrr|rzrr)rrr remain_bytes to_read_bytes read_datas rrzUnpacker._reserveisn4<((4<7!;  1   F = /DLO  ! # # 3t334 LLD0 0LL#$D %} #dl++ +d.C C C Q>>M++M::I i// / // LLI %LL C NN *LQ t|  q4</ / /O /DLO 0 / / /r c t}d}d}|d|j|j}|xjdz c_|dzdkr|}n|dzdkr d|dz z }n{|dzdkrH|dz}t}||jkrt |d |jd ||}n*|d zd kr3|d z}t}||j krt |d|j d n|d zdkr3|d z}t}||j krt |d|j d n|dkrd}n|dkrd}n|dkrd}nd|cxkrdkrnnt|\}}}||t|dkr'tj||j|jd}n|j|j}|xj|z c_||jkrt |d|jd ||}nd|cxkrdkrnnt|\}}}||tj||j|j\}}|xj|z c_||jkrt |d|jd ||}n!d|cxkrdkrnnt|\}}||t|dkr'tj||j|jd}n|j|j}|xj|z c_nd|cxkrdkrnnt|\}}}|j|krt |d|jd ||dztj||j|j\}}|xj|dzz c_nd|cxkrd krnnt|\}}}||t|dkr#tj||j|j\}n|j|j}|xj|z c_||jkrt |d |jd ||}n.d!|cxkrd"krnn~t|\}}}||tj||j|j\}|xj|z c_||j krt |d|j d nd#|cxkrd$krnn~t|\}}}||tj||j|j\}|xj|z c_||j krt |d|j d nt%d%|z|||fS)&Nrr(ruz exceeds max_str_len()z exceeds max_array_len(z exceeds max_map_len(FTrMrPz exceeds max_bin_len(rRrUz exceeds max_ext_len(rVrarbrlrmrorprqrrrszUnknown header: 0x%x)TYPE_IMMEDIATErr}r~TYPE_RAWrr<r TYPE_ARRAYrTYPE_MAPr_MSGPACK_HEADERSr struct unpack_fromrrr,)rtyprr5r^r&fmtLs r _read_headerzUnpacker._read_headers  a L &  z>Q  CC ^z ) )D/CC ^z ) )JAC4$$$ A!P!PDQ!T!T!TUUU' ^z ) )JAC4$$$ A!P!PDQ!T!T!TUUU' Q    $     -a0ND#s MM$   %c4<FFDQ LLD LL4$$$ A!P!PDz#Unpacker._unpack.. sQ..QRT\\,//l1K1KL......r z%s is not allowed for map keyutf_8rur(r0r1)&rEX_READ_ARRAY_HEADERrr<EX_READ_MAP_HEADERrEX_SKIPrangerCrrrrrr8rrr7strrrsysinternrrrdecoderTYPE_BINTYPE_EXTr/ from_bytesrto_unix to_unix_nano to_datetimerr) rexecuterrr5rrJrkeytss ` rrCzUnpacker._unpacks'')) Q * * *j   !1222H ( ( (h 000H *  '!!q**ALL))))q//C1XX 7 7 4<< 556666*ooc**.833eCjj 8 (??'!!q**ALL)))LL))))&2--....V[\]V^V^...q::A,,|44C+[S #u0M0M()H3tTWyy>>)YZZZ!#s++.!joo#||L99CHH$0++C00CJ g   F (??y @Cjjjj$*>??J (??::  (??Bww)%**55?a''::<<'_))??,,,_))>>+++I~~as444n$$$$ r c|Sr r#rs r__iter__zUnpacker.__iter__5s r c |t}||S#t$r|tt $rt wxYwr )rCrrr* StopIterationrDr-rrJs r__next__zUnpacker.__next__8sp ,,|,,C MMOOOJ   MMOOO      s /26A(cb|t|dSr )rCrrrs rskipz Unpacker.skipEs% W r c |t}n#t$rtwxYw||Sr )rCrrDr-rrs runpackzUnpacker.unpackIsM ,,|,,CC       s/cb|t}||Sr )rCrrrs rread_array_headerzUnpacker.read_array_headerQs&ll/00  r cb|t}||Sr )rCrrrs rread_map_headerzUnpacker.read_map_headerVs&ll-..  r c|jSr )rrs rtellz Unpacker.tell[s ""r )T)r r!r"__doc__r.rrBrrErFrrrrrrCrrnextrrrrrr#r rrArAs]]B )%Y:Y:Y:Y:v " " ",,, 000,,,     D^^^@+HHHHT    D  #####r rAceZdZdZ ddZeeefdZdZ dZ d Z d Z d Z d Zd ZefdZdZdZdZdZdZdS)Packera9 MessagePack Packer Usage:: packer = Packer() astream.write(packer.pack(a)) astream.write(packer.pack(b)) Packer's constructor has some keyword arguments: :param default: When specified, it should be callable. Convert user type to builtin type that Packer supports. See also simplejson's document. :param bool use_single_float: Use single precision float type for float. (default: False) :param bool autoreset: Reset buffer after each pack and return its content as `bytes`. (default: True). If set this to false, use `bytes()` to get content and `.reset()` to clear buffer. :param bool use_bin_type: Use bin type introduced in msgpack spec 2.0 for bytes. It also enables str8 type for unicode. (default: True) :param bool strict_types: If set to true, types will be checked to be exact. Derived classes from serializable types will not be serialized and will be treated as unsupported type and forwarded to default. Additionally tuples will not be serialized as lists. This is useful when trying to implement accurate serialization for python types. :param bool datetime: If set to true, datetime with tzinfo is packed into Timestamp type. Note that the tzinfo is stripped in the timestamp. You can get UTC datetime with `timestamp=3` option of the Unpacker. :param str unicode_errors: The error handler for encoding unicode. (default: 'strict') DO NOT USE THIS!! This option is kept for very specific usage. Example of streaming deserialize from file-like object:: unpacker = Unpacker(file_like) for o in unpacker: process(o) Example of streaming deserialize from socket:: unpacker = Unpacker() while True: buf = sock.recv(1024**2) if not buf: break unpacker.feed(buf) for o in unpacker: process(o) Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``OutOfData`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. Other exceptions can be raised during unpacking. NFTc||_||_||_||_t |_t ||_|pd|_|t|std||_ dS)Nrwzdefault must be callable) _strict_types _use_float _autoreset _use_bin_typer r}r _datetimerryr{_default)rdefaultuse_single_float autoreset use_bin_type strict_typesrrs rrzPacker.__init__sw**#)zz h-9  G$$ < :;;; r cd}|jr |}t}nttf} |dkrtd||jdS||t r6|r|jdS|jdS||trd|cxkrdkr0nn-|jtj d |Sd |cxkrdkr0nn-|jtj d |Sd|cxkrd kr1nn.|jtj d d|Sd|cxkrdkr1nn.|jtj dd|Sd |cxkrdkr1nn.|jtj dd|Sd|cxkrdkr1nn.|jtj dd|Sd|cxkrdkr1nn.|jtj dd|Sd|cxkrdkr1nn.|jtj dd|Sd|cxkrdkr1nn.|jtj dd |Sd!|cxkrdkr1nn.|jtj d"d#|S|s |j | |}d}td$||ttfrht|}|d%kr$td&t|jz|||j|S||t$rn|d'|j}t|}|d%krtd(|||j|S||t,rK|j}|d%krtd)|||j|S||t0rc|jr.|jtj d*d+|S|jtj d,d-|S||t4t6fr||t6rd.}|} n|j}|j} t?|tsJt?| tsJt| } | d/kr|jd0n| d1kr|jd2n| d3kr|jd4n| d5kr|jd6n| d7kr|jd8n| d kr/|jtj d9d:| nc| dkr/|jtj dd;| n.|jtj dd<| |jtj d ||j| dS|||rWt|}| |tC|D]!} |"|| |d/z "dS||tFr9|$t||%|d/z S|j&r0||tNr|j(t7j)|}d/}|s |j | |}d/}|j&r$||tNrtd=|d>tUd=|)?NFTrzrecursion limit exceededrBir^rBBrYiz>Bbr]>BHrZiz>Bhr_>BIr[iz>Bir`lz>BQr\lz>BqrazInteger value out of rangez%s is too largezutf-8zString is too largezMemoryview is too largez>BfrVz>BdrWrur(r0r2rXrg>BBrRrTrUzCannot serialize z where tzinfo=None)+rlistr8r<r}rrintrpackr OverflowErrorrrr r7r _pack_bin_headerrencoder_pack_raw_headerrnbytesfloatrr.r/to_bytescodedatar_pack_array_headerr_packdict_pack_map_pairsitemsr _DateTimetzinfo from_datetimer{) rr5 nest_limitcheckcheck_type_strict default_used list_typesrr$r%rrs rr'z Packer._packs   '%EJJJm 9A~~ !;<<<{|))'222uS$ 37<--g666|))'222uS# B????d?????<--fk#s.C.CDDDC####!#####<--fk#s.C.CDDD3&&&&$&&&&&<--fk$c.J.JKKKC####!#####<--fk%s.K.KLLL#'''''''''<--fk%s.K.KLLLc))))E)))))<--fk%s.K.KLLLC----:-----<--fk%s.K.KLLL#/////////<--fk%s.K.KLLL9999'999999<--fk%s.K.KLLL&#;;;; ;;;;;<--fk%s.K.KLLL# (A--,,C#'L#$@AAAuS5),-- /HH::$%6c9K%KLLL%%a(((|))#...uS# /jj$*>??HH::$%:;;;%%a(((|))#...uS*%% /J::$%>???%%a(((|))#...uS%   I?M<--fk%s.K.KLLL|))&+eT3*G*GHHHuS7I.// 5i(($D<<>>DD8D8D!$,,,,,!$.....II66L&&w////!VVL&&w////!VVL&&w////!VVL&&w////"WWL&&w////$YYL&&v{5$'B'BCCCC&[[L&&v{5$'B'BCCCCL&&v{5$'B'BCCC ""6;sD#9#9::: ""4(((uS*%% HH''***q77AJJs1vzA~6666uS$ S++CHHciikk:PQ>RRR~ %%Y"7"7 CJ>-.. . 66 L  w ' ' ' ' !VV L  w ' ' ' ' !VV L  w ' ' ' ' !VV L  w ' ' ' ' "WW L  w ' ' ' ' $YY L  wS!)<)<< = = = = &[[ L  wT1)=)== > > > > L  wT1)=)== > > > 6;sH55666 4     r c\|dkr0|jtjdd|zS|dkr.|jtjdd|S|dkr.|jtjdd |St d ) Nrr rrrrprrrqzArray is too larger}rrrr<rrs rr&zPacker._pack_array_headerws 99<%%fk#tax&@&@AA A ;;<%%fk%q&A&ABB B ??<%%fk%q&A&ABB B-...r c\|dkr0|jtjdd|zS|dkr.|jtjdd|S|dkr.|jtjdd |St d ) Nrr rrrrrrrrszDict is too largerErFs rr;zPacker._pack_map_headers 99<%%fk#tax&@&@AA A ;;<%%fk%q&A&ABB B ??<%%fk%q&A&ABB B,---r c|||D]7\}}|||dz |||dz 8dS)Nr()r;r')rrr5r.kvs rr)zPacker._pack_map_pairssf a    * *DAq JJq*q. ) ) ) JJq*q. ) ) ) ) * *r c|dkr2|jtjdd|zdS|jr6|dkr0|jtjdd|dS|dkr0|jtjdd |dS|d kr0|jtjd d |dSt d )Nrr rrrrmrrrnrrrozRaw is too large)r}rrrrr<rFs rr zPacker._pack_raw_headers 99 L  v{3q99 : : : : :   1AII L  v{5$:: ; ; ; ; ; &[[ L  v{5$:: ; ; ; ; ; *__ L  v{5$:: ; ; ; ; ;/00 0r c|js||S|dkr.|jt jdd|S|dkr.|jt jdd|S|dkr.|jt jdd |St d ) NrrrMrrrNrrrPzBin is too large)rr r}rrrr<rFs rrzPacker._pack_bin_headers! 1((++ + $YY<%%fk%q&A&ABB B &[[<%%fk%q&A&ABB B *__<%%fk%q&A&ABB B/00 0r c4|jS)z/Return internal buffer contents as bytes object)r}rrs rrz Packer.bytess|$$&&&r c,t|_dS)zYReset internal buffer. This method is useful only when autoreset=False. N)r r}rs rresetz Packer.resets  zz r ctr!t|S|jS)zReturn view of internal buffer.)USING_STRINGBUILDERrrr} getbufferrs rrRzPacker.getbuffers4  ,djjll++ +<))++ +r )NFTTFFN)r r!r"rrDEFAULT_RECURSE_LIMITrr9r'rr6r9r<rCr&r;r)r rrrOrRr#r rrr_s>BBL    2), z9z9z9z9x   !!!:///...4I**** 1 1 1 1 1 1'''""",,,,,r r)-rrr+rrhasattr__pypy__r__pypy__.buildersrr ImportErrorrQr ior$ exceptionsr)r*r+r,r-extr.r/rrrrrrrrrrrSr7r8r9r>rK_NO_FORMAT_USEDrrArr#r rr\s44******  73#$$!#&%%%%%4CCCCCCC 444333333334(((((((((& &&&&&&"?LRQQQQQQQQQQQQQ########       %)21ox (1dH  1dH  1dH    1eX    1eX   ) ) 1o  ) ) ) ( ) )  )!" 1eX #$ eX  eX  eX  vx ox ( dH  dH  dJ  dJ  dH  dH 9@U#U#U#U#U#U#U#U#pX,X,X,X,X,X,X,X,X,X,s + 99