2bi `SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK r SSK r SSK J r SSKJrJr SSKJr SSKJr SSKJrJrJrJr SS KJrJrJrJrJrJr SS KJ r! SS KJ"r"J#r#J$r$J%r%J&r&J'r'J(r( SS K)J*r* SS K+J,r,J-r-J.r.J/r/ SSK0J1r1 Sr2\Rf"5r4SSS.r5SRm\Rn"S\"SS9S55r8\RrS:XaSr:Sr"Sr;SrSr?\RS 5rAS!rBS"rCS#rDS$rESHS%jrFS&rGS'rHS(rIS)rJS*rKS+rLS,rMS-rN\O"S.5rPS/rQS0rRS1rSS2rTS3rUS4rV\RS55rWS6rXSIS7jrYS8rZSJS9jr[SKS:jr\S;r]S<r^S=RS>5r`\`S?-ra\`S@-rbSArcSBrdSCreSDrfSErgSFrhSGrig)Lz requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. N) OrderedDict) make_headers parse_url)certs __version__)_HEADER_VALIDATORS_BYTE_HEADER_VALIDATORS_STRHEADER_VALIDATORSto_native_string)Mapping basestringbytes getproxiesgetproxies_environment integer_types)parse_http_list) proxy_bypassproxy_bypass_environmentquotestrunquoteurlparse urlunparsecookiejar_from_dict)FileModeWarning InvalidHeader InvalidURLUnrewindableBodyError)CaseInsensitiveDict)z.netrc_netrcPi)httphttpsz, z,\s*T)accept_encodingzaccept-encodingwin32c,SSKnURURS5n[ UR US5S5nUR US5SnU(aU(dgURS5nUHsnUS:XaSU;a g URSS 5nURS S 5nURS S5n[R"XP[R5(dMs g g![a gf=f![ [4a gf=f)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet Settings ProxyEnable ProxyOverride;z.Tz\.*z.*?) winreg ImportErrorOpenKeyHKEY_CURRENT_USERint QueryValueExOSError ValueErrorsplitreplacerematchI)hostr0internetSettings proxyEnable proxyOverridetests ڌ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/requests/utils.pyproxy_bypass_registryrCLs   %~~((N   f112BMRSTUVK"//0@/RSTUM- &++C0 !Dy d?<<U+D<<U+D<<T*DxxBDD))"?  $  s#C0AD0 C=<C=DDcL[5(a [U5$[U5$)zReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. )rrrC)r=s rBrrps# " # #+D1 1(. .cH[US5(aUR5nU$)z/Returns an internal sequence dictionary update.items)hasattrrG)ds rBdict_to_sequencerJ|s!q' GGI HrEcSnSn[US5(a [U5nO[US5(a URnOm[US5(a\UR5n[R"U5R nSUR ;a[R"S[5 [US5(abUR5n[US5(a@Uc=URSS 5 UR5nURU=(d S5 UcSn[!SX- 5$![R[4a Nf=f![a SnNAf=f![a UbUnNVf=f) Nr__len__lenfilenoba%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.tellseek)rHrMrNosfstatst_sizemodewarningswarnrioUnsupportedOperationAttributeErrorrPrQr6max)o total_lengthcurrent_positionrNs rB super_lenr`siLq)1v E  uu H   XXZF88F+33L!&&  2$ q& % vvx q&!!l&: %FF1aL#$668LFF+0q1 q,1 22e''8    X%#$L%% 0 '#/  0s6D3?E%$!get_netrc_auth..s9[Rs8[sr)NetrcParseErrornetrc:asciirrR)rSenvironget NETRC_FILESrjripath expanduserKeyErrorexistsr isinstancerdecodenetlocr8authenticatorsr6r1r[)url raise_errors netrc_filenetrc_locationsrirj netrc_pathrflocrisplitstrr=r#login_is rBget_netrc_authrsW(J%-9[9- 0  A gg((+ww~~c"" !    c] c3  w/Hyyx(+ :&55d;F%ay!a333   : )    (   s`ED$"E EAE&4D- D*&E)D**E-EEEEEEc[USS5nU(aI[U[5(a3USS:wa)USS:wa[RR U5$gggg)z0Tries to guess the filename of the given object.nameNr<>)getattrrtrrSrpbasename)objrs rBguess_filenamersW 3 %D 4,,aCDHPSOww%%ET,trEc[RRU5(aU$[RRU5upU(a[RRU5(dh[RRU5upU(dO?SR X2/5nU(a&[RRU5(dMh[ R "U5(dU$[ R"U5nX$R5;aU$[R"5n[RR XRRS5S5n[RRU5(d6[U5nURURU55 SSS5 U$U$!,(df  U$=f)zReplace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. /rN)rSrprsr8joinzipfile is_zipfileZipFilenamelisttempfile gettempdir atomic_openwriteread)rparchivememberprefixzip_filetmpextracted_path file_handlers rBextract_zipped_pathsrsH  ww~~d ggmmD)OG "''..11''--0 6*+ "''..11   g & & w'H &&((     CWW\\#||C'8'<=N 77>>. ) )  (L   x}}V4 5) >) ( s !G Gc#T# [R"[RR U5S9up[R "US5nUv SSS5 [R "X 5 g!,(df  N%=f![a [R"U5 ef=f7f)z-Write a file to the disk in an atomic fashion)dirwbN) rmkstemprSrpdirnamefdopenr9 BaseExceptionremove)filenametmp_descriptortmp_name tmp_handlers rBrr,sz (//BGGOOH4MNN YY~t ,  - 8&- ,  ( s44B(BA2B1B(2 B<B"B%%B(cUcg[U[[[[45(a [ S5e[ U5$)aTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict N+cannot encode objects that are not 2-tuples)rtrrboolr4r7rvalues rBfrom_key_val_listr9s9$ }%#udC011FGG u rEcUcg[U[[[[45(a [ S5e[U[ 5(aUR5n[U5$)aTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list Nr) rtrrrr4r7rrGlistrs rBto_key_val_listrTsP" }%#udC011FGG%!!  ;rEc/n[U5H8nUSSUSSs=:XaS:XaO O[USS5nURU5 M: U$)aParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list Nrr")_parse_list_headerunquote_header_valueappend)rresultitems rBparse_list_headerrrsT.F"5) 8tBCy 'C ''Qr 3D d* MrEc0n[U5HKnSU;aSX'MURSS5up0USSUSSs=:XaS:XaO O[USS5nXU'MM U$)a"Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict =Nrrr)rr8r)rrrrs rBparse_dict_headerrsr,F"5) d?FL jja(  !9bc )c )(q5Et * MrEcU(aNUSUSs=:XaS:Xa;O U$USSnU(a USSS:wa"URSS5RS S5$U$) zUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str rrrrNrRz\\\z\")r9)r is_filenames rBrrsd qU2Y-#- La eBQi61==.66ucB B LrEcL0nUHnURXR'M U$)ztReturns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. :rtype: dict )rr)cj cookie_dictcookies rBdict_from_cookiejarrs+K#)<< KK  rEc[X5$)zReturns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar r)rrs rBadd_dict_to_cookiejarrs { //rEcZ[R"S[5 [R"S[R S9n[R"S[R S9n[R"S5nUR U5UR U5-UR U5-$)zdReturns encodings from given content string. :param content: bytestring to extract encodings from. zIn requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)z!])flagsz+]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])rWrXDeprecationWarningr:compiler<findall)content charset_re pragma_rexml_res rBget_encodings_from_contentrs  MM 1  @MJ IQSQUQUVI ZZ? @F 7#   G $ % .. ! "rEcPURS5nUSR5USSp20nSnUHrnUR5nU(dMUSpURS5n U S:wa*USU RU5nXiS-SRU5nXUR5'Mt X$4$) zReturns content type and parameters from given header :param header: string :return: tuple containing content type and dictionary of parameters r,rrNz"' Trr)r8stripfindlower) headertokens content_typeparams params_dictitems_to_stripparamkeyrindex_of_equalss rB_parse_content_type_headerrs\\# F!!9??,fQRj&KN  5#jjoO"$,_-33NC134::>J', $  $$rEcURS5nU(dg[U5upSU;aUSRS5$SU;agSU;agg) zqReturns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str z content-typeNcharsetz'"textz ISO-8859-1zapplication/jsonutf-8)rnrr)headersrrs rBget_encoding_from_headersrs^;;~.L 5lCLFi &&u-- \)*rEc## URc UShvN g[R"UR5"SS9nUH!nURU5nU(dMUv M# URSSS9nU(aUv ggNm7f)zStream decodes an iterator.Nr9errorsrET)final)encodingcodecsgetincrementaldecoderru)iteratorrdecoderchunkrvs rBstream_decode_response_unicoder3s~ zz**1::6iHG ^^E " 2H 4 (B   sBBAB&Bc## SnUbUS::a [U5nU[U5:aXX!-v X!- nU[U5:aMgg7f)z Iterate over slices of a string.rN)rM)string slice_lengthposs rB iter_slicesrDsP C|q06{ F 3-..  F s AAAcH[R"S[5 /n[UR5nU(a[ UR U5$[ UR USS9$![a URU5 N3f=f![a UR s$f=f)zReturns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str zIn requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)r9r) rWrXrrrrr UnicodeErrorr TypeError)rtried_encodingsrs rBget_unicode_from_responserNs MM 1  O)3H -qyy(+ + 199hy99  -  " "8 , - yys#A'B'BBB! B!zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~cURS5n[S[U55HpnXSSn[U5S:XaNUR5(a9[ [ US55nU[;aXAUSS-X'M\SX3X'MgSX3X'Mr S RU5$![ a [SUS35ef=f) zUn-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. :rtype: str %rrrRz"Invalid percent-escape sequence: ''N) r8rangerMisalnumchrr4r7r UNRESERVED_SETr)uripartsihcs rBunquote_unreservedr {s IIcNE 1c%j ! HQqM q6Q;199;; LAr ON"Qx|+uxj>58*~EH" 775> L #EaS!JKK Ls B,,CcdSnSn[[U5US9$![a [XS9s$f=f)zRe-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str z!#$%&'()*+,/:;=?@[]~z!#$&'()*+,/:;=?@[]~)safe)rr r )rsafe_with_percentsafe_without_percents rB requote_urirsG/0 5',3DEE 5S44 5s //c x[R"S[R"U55SnUR S5up4[R"S[R"[ [ U5555Sn[R"S[R"U55SU-nX%-Xe-:H$)zThis function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 :rtype: bool z=Lrr)structunpacksocket inet_atonr8dotted_netmaskr4)ipnetipaddrnetaddrbitsnetmasknetworks rBaddress_in_networkrs]]4!1!1"!5 6q 9FIIcNMGmmD&"2"2>#d)3L"MNqQGmmD&"2"27";I)r inet_ntoarpack)maskrs rBrrs7 b4i1, ,D   FKKd3 44rEcR[R"U5 g![a gf=f)z :rtype: bool FT)rrr6) string_ips rBis_ipv4_addressr's.#  s  &&cURS5S:XaU[URS5S5nUS:dUS:ag[R "URS5S5 gg![a gf=f![ a gf=f)zJ Very simple check of the cidr format in no_proxy variable. :rtype: bool rrFr!rT)countr4r8r7rrr6)string_networkr$s rB is_valid_cidrr+s C A% ~++C034D !8tby    ^11#6q9 :     s#A,(A<, A98A9< B B c#Z# USLnU(a2[RRU5nU[RU'Sv U(a)Wc[RU gU[RU'gg!U(a)Wc[RU fU[RU'ff=f7f)zSet the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothingN)rSrmrn)env_namer value_changed old_values rB set_environr0s%MJJNN8, $ 81  JJx('0 8$ = JJx('0 8$ s>B+A61B+62B((B+c*SnUnUcU"S5n[U5nURcgU(aSURSS5RS55n[ UR5(aKUHDn[ U5(a[ URU5(a gM2URU:XdMD g OpURnUR(aUS UR3- nUH;nURRU5(dURU5(dM; g [SU5 [UR5nSSS5 W(agg ![[R4a S nN/f=f!,(df  N9=f) z@ Returns whether we should bypass proxies or not. :rtype: bool c[RRU5=(d- [RRUR55$N)rSrmrnupper)rs rB get_proxy(should_bypass_proxies..get_proxys-zz~~c"AbjjnnSYY[&AArENno_proxyTc36# UHo(dM Uv M g7fr3rd)rer=s rBrg(should_bypass_proxies..sR%ITTDD%Is   r,:F)rhostnamer9r8r'r+rportendswithr0rrrgaierror) rxr7r5 no_proxy_argparsedproxy_iphost_with_portr=bypasss rBshould_bypass_proxiesrFs^B LZ( c]F SX%5%5c2%>%D%DS%IR 6?? + +$ **)&//8DD#E__0 %$__N{{Afkk]"33 ??++D11^5L5LT5R5R ! Z . !&//2F /  6??+ F  / .s*:F<E""F>FFF Fc6[XS9(a0$[5$)z5 Return a dict of environment proxies. :rtype: dict r7)rFr)rxr7s rBget_environ_proxiesrI8s S4 |rEc>U=(d 0n[U5nURc+URURURS55$URS-UR-URSUR-S/nSnUHnXQ;dM Xn U$ U$)zSelect a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs Nallz://zall://)rr=rnscheme)rxproxiesurlparts proxy_keysproxy proxy_keys rB select_proxyrRDs mG}H {{8??GKK,>?? %("3"338$$$ J E  &E  L  LrEcDUbUO0nURn[U5RnURS5nUR 5nU(aO[ X5S9(dA[ X5S9nURXGRS55nU(aURXH5 U$)aThis method takes proxy information from a request and configuration input to resolve a mapping of target proxies. This will consider settings such a NO_PROXY to strip proxy configurations. :param request: Request or PreparedRequest :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs :param trust_env: Boolean declaring whether to trust environment configs :rtype: dict r7rHrK)rxrrLrncopyrFrI setdefault) requestrM trust_envrxrLr7 new_proxiesenviron_proxiesrPs rBresolve_proxiesrZ^s!,g"G ++C c] ! !F{{:&H,,.K.sF-cE##F,?,?,FG   " "6 1 rEcUS[3$)zC Return a string representing the default user agent. :rtype: str rr)rs rBdefault_user_agentr\ys V1[M ""rEc:[[5[SSS.5$)z1 :rtype: requests.structures.CaseInsensitiveDict z*/*z keep-alive)z User-AgentzAccept-EncodingAccept Connection)r"r\DEFAULT_ACCEPT_ENCODINGrdrErBdefault_headersras% ,.6&   rEc/nSnURU5nU(dU$[R"SU5HnURSS5upESURS50nURS5H9nURS5upURU5XhRU5'M; UR U5 M U$![a USpTNf=f![a  M8f=f) zReturn a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list z '"z, * '"r)rr:r8r7r) rlinks replace_charsvalrxrlinkrrs rBparse_header_linksrgs EM KK &E  xx& "))C+KCsyy*+\\#&E "[[- .3[[-GD=) * '  T!'$ L "r "  s#C6C CC C('C(rlrRcUSSnU[R[R4;agUSS[R:XagUSS[R[R 4;agUR [5nUS:Xag US:Xa"USSS2[:Xag US SS2[:Xag US:XaUSS[:Xag US S[:Xagg)z :rtype: str Nzutf-32riz utf-8-sigrRzutf-16rrz utf-16-berz utf-16-lez utf-32-bez utf-32-le) r BOM_UTF32_LE BOM_UTF32_BEBOM_UTF8 BOM_UTF16_LE BOM_UTF16_BEr)_null_null2_null3)datasample nullcounts rBguess_json_utfrws"1XF &%%v':':;; bqzV__$ bqzf))6+>+>?? U#IA~A~ #A#;&  !$Q$<6 !A~ "1:  !":  rEc[U5nUup4pVpxn URn U (dXzpzU(aSRXJ/5n UcUnUcSn[X:USX45$)zGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str @r)rrvrr) rx new_schemerBrLauthr=r>rpqueryfragmentrvs rBprepend_scheme_if_neededr~sk s^F6<3F$d8 ]]F  4.) ~ | vtRA BBrEc[U5n[UR5[UR54nU$![[ 4a SnU$f=f)zoGiven a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) )rr)rrusernamepasswordr[r)rxrBr{s rBget_auth_from_urlrsU c]F('&//*BC K I & Ks*9AAc<Uup[XS5 [XS5 g)zVerifies that header parts don't contain leading whitespace reserved characters, or return characters. :param header: tuple, in the format (name, value). rrN)_validate_header_part)rrrs rBcheck_header_validityrs KD&*&+rEc  [U[5(a [UnO=[U[5(a [UnO[ SU<SUS[ U535eURU5(dUS:XaSOSn[ SUSU<35eg) Nz Header part (z) from z# must be of type str or bytes, not rrrzSInvalid leading whitespace, reserved character(s), or returncharacter(s) in header z: )rtrr rr rtyper;)r header_partheader_validator_index validator header_kinds rBrrs+s##*+AB K ' '+,BC K?'&:115k1B0C E  ??; ' ' 6! ;f &&1]"[O E   (rEcz[U5upp4pVU(dX2p2URSS5Sn[XX4US45$)zK Given a url remove the fragment and the authentication part. :rtype: str ryrrr)rrsplitr)rxrLrvrprr|r}s rB urldefragauthr&sG 5=SM1FD%  ]]3 "2 &F vtUB? @@rEc[URSS5nUb3[UR[5(aU"UR5 g[ S5e![ a [ S5ef=f)z^Move file pointer back to its recorded starting position so it can be read again on redirect. rQNz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)rbodyrt_body_positionrr6r!)prepared_request body_seeks rB rewind_bodyr7sy(--vtrs #<$ :) ," c* ))HHWl489JKL <<7"H / ?3D6 r&"J   6<@F2 02%22"$PM 05, 550 11*9x 46# "L  g  @C:  , &A"SrE