8fiX 4ddlmZddlmZddlZddlmZddlmZm Z m Z ddl m Z m Z mZmZmZmZddlmZmZmZed ed Deed zZeed z Zeed z ZeZeZeZedZeedzZ eej!ej"zdzZ#e#edzZ$eej%Z&edd ddddddZ'Gdde(Z)e*dd]d!Z+e*dd^d$Z,Gd%d&Z-Gd'd(Z.Gd)d*e Z/d_d0Z0d`d6Z1dad7Z2dad8Z3dbd;Z4dbd<Z5dcd?Z6dddAZ7dedBZ8dfdDZ9dfdEZ:dgdGZ;dhdIZdjdQZ?dfdRZ@dkdTZAdidUZBdldWZCdmdYZDdnd[ZEdod\ZFdS)p) annotations)IterableN)MappingProxyType)AnyBinaryIO NamedTuple) RE_DATETIME RE_LOCALTIME RE_NUMBERmatch_to_datetimematch_to_localtimematch_to_number)Key ParseFloatPosc#4K|]}t|VdSN)chr).0is y/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/tomli/_parser.py rs(11!s1vv111111  z z  z-_z"'  "\)z\bz\tz\nz\fz\rz\"z\\ceZdZdZdS)TOMLDecodeErrorz0An error raised if a document is not valid TOML.N)__name__ __module__ __qualname____doc__rrr%r%5s::::rr% parse_float__fprr,rreturndict[str, Any]c|} |}n#t$rtddwxYwt ||S)z%Parse TOML from a binary file object.zEFile must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`Nr+)readdecodeAttributeError TypeErrorloads)r-r,bss rloadr89sk A HHJJ  S     , , ,,s +A__sstrcd|dd}d}ttt}d}t |} t ||t } ||}n#t$rYn&wxYw|dkr|dz }>|tvr*t|||||}t ||t }n|dkr~ ||dz}n#t$rd}YnwxYw|j |dkrt|||\}}nt|||\}}t ||t }n|d krt||d t||} ||}n#t$rYn"wxYw|dkrt||d |dz }S|jjS) zParse TOML from a string.z rrr*Tr [N#zInvalid statementz5Expected newline or end of document after a statement)replaceOutput NestedDictFlagsmake_safe_parse_float skip_charsTOML_WS IndexErrorKEY_INITIAL_CHARSkey_value_ruleflagsfinalize_pendingcreate_list_rulecreate_dict_rule suffixed_err skip_commentdatadict)r9r,srcposoutheaderchar second_chars rr5r5Es ++fd # #C C uww ' 'CF' 44K0c7++ s8DD    E  4<< 1HC  $ $ $ c3 DDCS#w//CC S[[ #*-cAg,  # # #"  # I & & ( ( (c!!.sC== VV.sC== VS#w//CC S[[sC)<== =3$$ s8DD    E  4<<SQ  qa0d 8=s6*A33 BB C C%$C%/E88 FFcJeZdZdZdZdZddZdd Zdd Zdd Z ddZ ddZ dS)rAz)Flags that map to parsed keys/namespaces.rr r.Nonec:i|_t|_dSr)_flagsset_pending_flagsselfs r__init__zFlags.__init__s') 47EErkeyrflagintc>|j||fdSr)r[addr]r_r`s r add_pendingzFlags.add_pendings# d ,,,,,rc|jD]\}}|||d|jdS)NF recursive)r[rZclearrds rrIzFlags.finalize_pendingsN, 1 1IC HHS$%H 0 0 0 0 !!#####rc|j}|ddD]}||vrdS||d}||dddS)Nnested)rYpop)r]r_contks r unset_allzFlags.unset_alls^{SbS % %A}}78$DD R$rrhboolc<|j}|dd|d}}|D]5}||vr!ttid||<||d}6||vr!ttid||<|||rdnd|dS)Nrk)rHrecursive_flagsrlrlrsrH)rYrZrc)r]r_r`rhrn key_parentkey_stemros rrZz Flags.sets{"3B3xRH  % %A}}$'EEceerRRQ78$DD 4  '*uuRTUUDN XIB((7CGGMMMMMrc|sdS|j}|ddD]&}||vrdS||}||dvrdS|d}'|d}||vr||}||dvp ||dvSdS)NFrkrsTrlrH)rY)r]r_r`rnro inner_contrus ris_z Flags.is_s 5{SbS ( (A}}uuaJz"3444tth'DDr7 t  >D4=(KDD9J4K,K KurNr.rW)r_rr`rar.rWr_rr.rW)r_rr`rarhrqr.rW)r_rr`rar.rq) r&r'r(r)FROZEN EXPLICIT_NESTr^rerIrprZrxr*rrrArAs33FM::::----$$$$      N N N NrrAc,eZdZddZdddd Zdd Zd S)r@r.rWci|_dSr)rOr\s rr^zNestedDict.__init__s $& rT access_listsr_rrrqrOc|j}|D]V}||vri||<||}|rt|tr|d}t|tstdW|S)Nrkz There is no nest behind this key)rO isinstancelistKeyError)r]r_rrnros rget_or_create_nestzNestedDict.get_or_create_nests I C CA}}Q7D 4 6 6 BxdD)) CABBB C rc||dd}|d}||vrC||}t|tstd|idSig||<dS)Nrkz/An object other than list found behind this key)rrrrappend)r]r_rnlast_keylist_s rappend_nest_to_listzNestedDict.append_nest_to_lists&&s3B3x00r7 t  NEeT** RPQQQ LL      TDNNNrNry)r_rrrqr.rOrz)r&r'r(r^rrr*rrr@r@s_''''" " " " " " " "rr@c$eZdZUded<ded<dS)r?r@rNrArHN)r&r'r(__annotations__r*rrr?r?s%LLLLLrr?rPrQrchars Iterable[str]c\ |||vr|dz }|||vn#t$rYnwxYw|S)Nr )rE)rPrQrs rrCrCsV #h% 1HC#h%      Js  ))expecterror_onfrozenset[str] error_on_eofrqcB |||}n6#t$r)t|}|rt||d|dYnwxYw||||s3|||vr|dz }|||vt||d|||S)Nz Expected r zFound invalid character )index ValueErrorlenrL isdisjoint)rPrQrrrnew_poss r skip_untilrsO))FC(( OOOc((  OsG-C-C-CDD$ N O OO   s3w;/ 0 0N#hh&& 1HC#hh&&3%LC%L%LMMM Ns0A  A c ||}n#t$rd}YnwxYw|dkrt||dzdtdS|S)Nr=r rFrr)rErILLEGAL_COMMENT_CHARS)rPrQrTs rrMrMsms8  s{{ q$)>U     J  cf |}t||t}t||}||kr|S1r)rCTOML_WS_AND_NEWLINErM)rPrQpos_before_skips rskip_comments_and_array_wsrsBc#6773$$ / ! !J rrRtuple[Pos, Key]c>|dz }t||t}t||\}}|j|t js%|j|t jrt||d|d|j |t jd |j |n #t$rt||ddwxYw| d|st||d|dz|fS) Nr zCannot declare z twiceFrgCannot overwrite a value]z.Expected ']' at the end of a table declaration)rCrD parse_keyrHrxrAr|r{rLrZrNrr startswithrPrQrRr_s rrKrKs-1HC S#w ' 'Cc""HC y}}S%-..D#)--U\2R2RD3%Bs%B%B%BCCCIMM#u*eM<<<K ##C(((( KKK3%?@@dJK >>#s # #W3%UVVV 7C<s 6CC.c&|dz }t||t}t||\}}|j|t jrt||d||j||j |t j d |j |n #t$rt||ddwxYw|d|st||d|dz|fS)N"Cannot mutate immutable namespace Frgrz]]z0Expected ']]' at the end of an array declaration)rCrDrrHrxrAr{rLrprZr|rNrrrrs rrJrJ.s%1HC S#w ' 'Cc""HC y}}S%,''Q3%O#%O%OPPPIIMM#u*eM<<<K $$S)))) KKK3%?@@dJK >>$ $ $Y3%WXXX 7C<s *CC"rSrc& t|||\} } dd d}}|z} fdtdt D} | D]`} |j| t jrt||d| |j| t ja|j|t j rt||d| |j |} n #t$rt||ddwxYw|| vrt||dt|ttfr*|j zt j d|| |<|S) Nrkc32K|]}d|zVdSrr*)rrrSr_s rrz!key_value_rule..Js0LLAvBQB/LLLLLLrr zCannot redefine namespace rrTrg)parse_key_value_pairrangerrHrxrAr|rLrer{rNrrrrOrrZ) rPrQrRrSr,valuertruabs_key_parentrelative_path_cont_keyscont_keynestr_s ` @rrGrGCs+3[AAOCess8SWJj(NLLLLLq#c((9K9KLLL+== 9==5#6 7 7 RsC)Ph)P)PQQ Q h(;<<<< y}}^U\22  K>KK   Kx**>:: KKK3%?@@dJK43%?@@@%$&&B fslELD AAADN Js 6DD.tuple[Pos, Key, Any]ct||\}} ||}n#t$rd}YnwxYw|dkrt||d|dz }t||t}t |||\}}|||fS)N=z,Expected '=' after a key in a key/value pairr )rrErLrCrD parse_value)rPrQr,r_rTrs rrresc""HCs8  s{{3%STTT1HC S#w ' 'CS#{33JC U?s  --c>t||\}}|f}t||t} ||}n#t$rd}YnwxYw|dkr||fS|dz }t||t}t||\}}||fz }t||t}q)NT.r )parse_key_partrCrDrE)rPrQkey_partr_rTs rrrus"3,,MC{C S#w ' 'C , "3xDD   DDD  3;;8O qc7++&sC00 X {c7++ ,s8 AAtuple[Pos, str]c ||}n#t$rd}YnwxYw|tvr$|}t||t}||||fS|dkrt||S|dkrt ||St ||d)N'r"z(Invalid initial character for a key part)rEBARE_KEY_CHARSrCparse_literal_strparse_one_line_basic_strrL)rPrQrT start_poss rrrss8  ~ c>22C # &&& s{{ c*** s{{'S111 sC!K L LLrc0|dz }t||dS)Nr F multiline)parse_basic_strrPrQs rrrs 1HC 3u 5 5 55rtuple[Pos, list]c|dz }g}t||}|d|r|dz|fS t|||\}}||t||}|||dz}|dkr|dz|fS|dkrt ||d|dz }t||}|d|r|dz|fS)Nr rT,zUnclosed array)rrrrrL)rPrQr,arrayvalcs r parse_arrayrs1HCE $S# . .C ~~c3Qw~"sC55S S(c22 cAg  887E> ! 88sC)9:: : q(c22 >>#s # # "7E> !"rtuple[Pos, dict]cf|dz }t}t}t||t}|d|r |dz|jfS t |||\}}}|dd|d}}||tjrt||d| | |d} n #t$rt||ddwxYw|| vrt||d ||| |<t||t}|||dz} | dkr |dz|jfS| d krt||d t|t tfr"||tjd |dz }t||t}X) Nr }TrkrFrrzDuplicate inline table key rzUnclosed inline tablerg)r@rArCrDrrOrrxr{rLrrrrrZ) rPrQr, nested_dictrHr_rrtrurrs rparse_inline_tablers1HC,,K GGE S#w ' 'C ~~c3)Qw (((,.sCEES%"3B3xRH 99S%, ' ' UsC)Sc)S)STT T O11*51QQDD O O OsC)CDD$ N O t  sC)Sx)S)STT TXc7++ cAg  887K,, , 88sC)@AA A edD\ * * 9 IIc5<4I 8 8 8 qc7+++,s 7CC,Frrc|||dz}|dz }|rt|dvrp|dkrPt||t} ||}n#t$r|dfcYSwxYw|dkrt||d|dz }t||t}|dfS|dkrt ||d S|d krt ||d S |t |fS#t$rt||ddwxYw) Nr>\ \ \ rrzUnescaped '\' in a stringr z\uz\U)rCrDrErLrparse_hex_charBASIC_STR_ESCAPE_REPLACEMENTSr)rPrQr escape_idrTs rparse_basic_str_escapersMC#'M"I1HC Y"999   S#w//C 3x   Bw t||"3-IJJJ 1HCc#677BwEc3***Ec3***M1)<<< MMM3%ABBLMs?AA8CC$c&t||dS)NTr)rrs r parse_basic_str_escape_multiliners !#sd ; ; ;;rhex_lenrac$||||z}t||kst|st||d||z }t |d}t |st||d|t |fS)NzInvalid hex valuez/Escaped character is not a Unicode scalar value)rHEXDIGIT_CHARS issupersetrLrais_unicode_scalar_valuer)rPrQrhex_strhex_ints rrrs#g %&G 7||wn&?&?&H&H3%89997NC'2G "7 + +X3%VWWW G rc`|dz }|}t||dtd}|dz|||fS)Nr rTr)rILLEGAL_LITERAL_STR_CHARS)rPrQrs rrrsJ1HCI  S# 9   C 7C # & &&rliteralc`|dz }|d|r|dz }|r+d}t||dtd}|||}|dz}nd}t||d \}}|||s||fS|dz }|||s|||zfS|dz }|||d zzfS) Nrr r'''Trr"rr)rr#ILLEGAL_MULTILINE_LITERAL_STR_CHARSr)rPrQrdelimend_posresults rparse_multiline_strr s1HC ~~dC   q @   8    S[!k%c3$??? V >>% % %F{1HC >>% % %#FUN""1HC %!)$ $$rc|rt}t}nt}t}d}|} ||}n #t$rt ||ddwxYw|dkrB|s|dz||||zfS|d|r|dz||||zfS|dz }s|dkr$||||z }|||\}}||z }|}||vrt ||d ||dz }) NrTzUnterminated stringr"r """rr#zIllegal character )!ILLEGAL_MULTILINE_BASIC_STR_CHARSrILLEGAL_BASIC_STR_CHARSrrErLr) rPrQrr parse_escapesrrrT parsed_escapes rrr(sY/48 *. FI Js8DD J J JsC)>??T I J 3;; <QwYs]); ;;;~~eS)) <QwYs]); ;;; 1HC  4<< c)C-( (F!.sC!8!8 C m #FI  8  sC)Fd)F)FGG G q)s /A tuple[Pos, Any]cn ||}n#t$rd}YnwxYw|dkr8|d|rt||dSt||S|dkr8|d|rt||dSt ||S|dkr|d |r|d zdfS|d kr|d |r|d zdfS|dkrt |||S|dkrt |||Stj||}|rK t|}n$#t$r}t||d|d}~wwxYw| |fStj||}|r#| t|fStj||}|r$| t!||fS|||dz} | dvr|dz|| fS|||d z} | dvr|d z|| fSt||d)Nr"rF)rrrTttruerffalser<{zInvalid date or datetimer>infnan>+inf+nan-inf-nanz Invalid value)rErrrrrrr matchr rrLendr rr r) rPrQr,rTdatetime_match datetime_objelocaltime_match number_match first_three first_fours rrrHss8   s{{ >>% % % @&sC??? ?'S111 s{{ >>% % % ?&sC>>> > c*** s{{ >>&# & & !7D=  s{{ >>'3 ' ' "7E> ! s{{3[111 s{{!#sK888!&sC00N2 L,^<.coord_reprsu #c((??$$yyq#&&* 1991WFF3::dAs333F.t..f...rz (at ))rPr:rQrr.r:)r%)rPrQrrs rrLrLsC//// c?? 3(<(<??? @ @@r codepointcBd|cxkodkncpd|cxkodkncS)Nriiir*)rs rrrsE  # # # #e # # # # G))F)F)F)Fw)F)F)F)FGrc4turtSdfd }|S)a%A decorator to make `parse_float` safe. `parse_float` must not return dicts or lists, because these types would be mixed with parsed TOML tables and arrays, thus confusing the parser. The returned decorated callable raises `ValueError` instead of returning illegal types. float_strr:r.rct|}t|ttfrtd|S)Nz*parse_float must not return dicts or lists)rrOrr)r float_valuer,s rsafe_parse_floatz/make_safe_parse_float..safe_parse_floats>!k),, kD$< 0 0 KIJJ Jr)rr:r.r)float)r,r"s` rrBrBs;e  r)r-rr,rr.r/)r9r:r,rr.r/)rPr:rQrrrr.r) rPr:rQrrr:rrrrqr.r)rPr:rQrr.r)rPr:rQrrRr?r.r) rPr:rQrrRr?rSrr,rr.r)rPr:rQrr,rr.r)rPr:rQrr.r)rPr:rQrr.r)rPr:rQrr,rr.r)rPr:rQrr,rr.r)rPr:rQrrrqr.r)rPr:rQrrrar.r)rPr:rQrrrqr.r)rPr:rQrr,rr.r)rPr:rQrrr:r.r%)rrar.rq)r,rr.r)G __future__rcollections.abcrstringtypesrtypingrrr_rer r r r rr_typesrrr frozensetrr ASCII_CTRLrrrrrrDr ascii_lettersdigitsrrF hexdigitsrrrr%r#r8r5rAr@r?rCrrMrrKrJrGrrrrrrrrrrrrrrLrrBr*rrr0s #"""""$$$$$$ """""",,,,,,,,,,)((((((((( Y11uuRyy111 1 1IIcc#hh4G4G G %yy6$.61B1B$B!3&G#/ )E   $/6/&-?$FGG"YYu%5%556+,, 0 0 ! !;;;;;j;;;7< - - - - - -27??????D77777777t""""""""DZ ,    $*D     ,,,,$ M M M M 6666 """"0,,,,B.3MMMMMM:<<<<''''%%%%>@A2A2A2A2HAAAA"HHHHr