Files
intellecton/venv/lib/python3.12/site-packages/requests/__pycache__/utils.cpython-312.pyc
T

359 lines
39 KiB
Plaintext
Raw Normal View History

Ë
ãóBUdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddl Z ddl Z ddl
Z
ddlmZddlmZmZddlmZmZmZmZmZmZddlmZmZdd lmZdd
lmZdd l m!Z!m"Z"m#Z#m$Z$dd l%m&Z'dd
l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl(m6Z7ddl8m9Z9ddl:m;Z;m<Z<m=Z=m>Z>ddl?m@Z@erddlAmBZBddlmCZCddlm%ZDddlEmFZFmGZGmHZHdZIdeJd<ej«ZLdeJd<dddœZMdeJd<ed«ZNed «ZOd!j¡ed"ed#¬$«d%««ZRdeJd&<e
d'k(rd\d(„ZTd\d)„Z/ d]d*„ZUd^d+„ZV d_ d`d,„ZWdad-„ZXdbd.„ZYej´dcd/„«Z[ ddd0„Z\eded1„«Z]e dfd2„«Z] dgd3„Z]dhd4„Z^did5„Z_d_djd6„Z`dkd7„Zadld8„Zbdmd9„Zcdnd:„Zddod;„Ze dpd<„Zfe dqd=„«Zge drd>„«Zg dsd?„Zgdtd@„ZheidA«ZjdeJdB<dudC„ZkdudD„ZldvdE„ZmdwdF„ZndxdG„ZodydH„Zpej´dzdI„«Zqd{dJ„Zrd|d}dK„Zsd~dL„Zt d d€dM„ZudddN„ZvdƒdO„Zwd„dP„ZxdQjódR«ZzezdSzZ{ezdTzZ|d…dU„Z}d†dV„Z~d‡dW„ZdˆdX„Z€ d‰dY„ZdŠdZ„Zdd[„Zƒy)Œz”
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
é)Ú annotationsN)Ú OrderedDict)Ú GeneratorÚIterable)Ú
TYPE_CHECKINGÚAnyÚFinalÚTypeVarÚcastÚoverload)Ú make_headersÚ parse_urlé)Úcerts©Ú __version__)Ú_HEADER_VALIDATORS_BYTEÚ_HEADER_VALIDATORS_STRÚHEADER_VALIDATORSÚto_native_string)Ú
SupportsItems)
ÚMappingÚbytesÚ
getproxiesÚgetproxies_environmentÚ
integer_typesÚ is_urllib3_1Ú proxy_bypassÚproxy_bypass_environmentÚquoteÚstrÚunquoteÚurlparseÚ
urlunparse)Úparse_http_list©Úcookiejar_from_dict)ÚFileModeWarningÚ
InvalidHeaderÚ
InvalidURLÚUnrewindableBodyError)ÚCaseInsensitiveDict)Ú CookieJar)ÚBufferedWriter)Ú_types)ÚPreparedRequestÚRequestÚResponse)z.netrcÚ_netrcr Ú NETRC_FILESr!ÚDEFAULT_CA_BUNDLE_PATHéP)ÚhttpÚhttpsÚ
DEFAULT_PORTSÚ_KTÚ_VTz, z,\s*T)Úaccept_encodingzaccept-encodingÚDEFAULT_ACCEPT_ENCODINGÚwin32có ddl} |j|jd«}t |j |d«d«}|j |d«d}|r|sy|jd«}td|«}|D]j}|dk(rd|vry |jdd
«}|jd d «}|jd
d«}tj||tj«sŒjy y#t$rYywxYw#t tf$rYywxYw)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet SettingsÚ ProxyEnableÚ
ProxyOverrideú;z<local>ú.Tz\.Ú*z.*ú?)ÚwinregÚ ImportErrorÚOpenKeyÚHKEY_CURRENT_USERÚintÚ QueryValueExÚOSErrorÚ
ValueErrorÚsplitÚfilterÚreplaceÚreÚmatchÚI)ÚhostrFÚinternetSettingsÚ proxyEnableÚ
proxyOverrideÚtests úQ/home/antigravity/intellecton/venv/lib/python3.12/site-packages/requests/utils.pyÚproxy_bypass_registryrZcs%ð Û ð
Ø%Ÿ~™~Ø× Ð ô
˜f×1Ð2BÀMÓRÐSTÑVˆ"×/Ð0@À/ÓRÐSTÑUˆMñ¡-Øð
&×+¨CÓ0ˆ
ä˜t 3ˆ
à ˆDØ Ø˜dØ—<<  +ˆ—<<  +ˆ—<<  *ˆx‰x˜˜d¤B§D¡DÕð ðøôCò Ùð ûôœÐ Ùð ús#C(‡AC7Ã( C4Ã3C4Ã7D ÄD cóBt«r t|«St|«S)zšReturn True, if the host should be bypassed.
Checks proxy settings gathered from the environment, if specified,
or the registry.
)rrrZ)rTs rYrrs ô +¨DÓ Ó cóFt|t«r|j«S|S)z/Returns an internal sequence dictionary update.)Ú
isinstanceÚ_SupportsItemsÚitems)Úds rYÚdict_to_sequencerbsô
!”^Ôw‰wà €Hr\cóöd}d}ts!t|t«r|jd«}t |d«r t |«}n~t |d«r
|j
}net |d«rY |j
«}tj|«j}d|jvrtjdt« t |d«rW |j#«}t |d «r:|€8 |j%dd
«|j#«}|j%|xsd«|d}t)d||z
«S#tjt f$rYŒ‘wxYw#t&$rd}YŒ?wxYw#t&$r||}YŒRwxYw) Nrúutf-8Ú__len__ÚlenÚfilenoÚba%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.ÚtellÚseeké)rr^r!ÚencodeÚhasattrrfrgÚosÚfstatÚst_sizeÚmodeÚwarningsÚwarnr(ÚioÚUnsupportedOperationÚAttributeErrorrirjrLÚmax)Ú total_lengthÚcurrent_positionrgs rYÚ super_lenr{ syØ€LØÐå œJ q¬#Ô
H‰H ˆäˆqܘ1“v‰ ä Ø—u‘u‰ ä ð Ø—X‘X“ZˆFôŸ8™8 FÓ+×3ˆ˜!Ÿ&™&Ñ Ü
ð
ôˆqð Ÿv™v ôq˜! lÐ&:ð —FF˜1˜a”LØ#$§6¡6£8—F‘FÐ0¨qÔÐØˆ ä ˆq,Ð!1Ñ 2øôe×Ð ñ
ð  ûôXò%Ø#$%ûô%ò
Ð'Ø#/Ð ùð
 0ús6Á*D8ÃE(Ã.7EÄ8EÅEÅ E%Å$E%Å(
E8Å7E8có`t|t«r|jd«}tjj d«}||f}n
dt D«} ddlm}m}d}|D]D}tjj|«}tjj|«sŒB|}n|yt|«} | j}
|
y ||«j|
«} | r't| «r| drdnd} | | xsd| d xsdfSyy#|t f$r|rYywxYw#t"t$f$rYywxYw)
z;Returns the Requests tuple auth for a given url from netrc.rdÚNETRCNc3ó&K|] }d|Œ y­w)z~/N©)Ú.0Úfs rYú <genexpr>z!get_netrc_auth.<locals>.<genexpr>ósèø€Ò˜R ˜sœ8Ñ9ùsr)ÚNetrcParseErrorÚnetrcrÚrk)r^rÚdecodernÚenvironÚgetr4r„ÚpathÚ
expanduserÚexistsr#ÚhostnameÚauthenticatorsÚanyrLrGrv)
ÚurlÚ raise_errorsÚ
netrc_fileÚnetrc_locationsrƒr„Ú
netrc_pathrÚlocÚrirTr3Úlogin_is
rYÚget_netrc_authr—çs@ô
#”uÔØj‰j˜Óä Ó(€JØÐØ%˜-‰á9¬[Ôð#
߈
à ò ˆ—''×$ 'ˆw‰w~‰~˜
Ùð  ð Ð Ø ä
c‹]ˆØ{‰{ˆà ˆ<Ø ð
Ù˜&×5°dÓ;ˆœ#˜fœ+à% ašy™!¨aؘw™Ò-¨2¨v°a©yª¸BÐ&ˆvøð ¤Ð ñØñð ûô
œÐ 
Ù ð
ús=ÁA
DÂ#DÂ+DÃ>DÄDÄDÄDÄDÄD-Ä,D-có²t|dd«}|rHt|ttf«r1|ddk7r(|ddk7rtj
j
|«Syyyy)z0Tries to guess the filename of the given object.ÚnameNrú<éÿÿÿÿú>)Úgetattrr^r!rrnr‰Úbasename)Úobjr™s rYÚguess_filenamer sXä  Ó %€DÙ
˜4¤#¤u Ô.°4¸±7¸c²>ÀdÈ2ÁhÐRUÂoÜw‰w×Ñ ÓGV°>Ð.€tr\cóFtjj|«r|Stjj|«\}}|rytjj|«sZtjj|«\}}|sn5dj ||g«}|r tjj|«sŒZt j |«s|St j|«}||j«vr|Stjj|jd«d«d}tj|¬«\}} tj||j|««tj|«|S#tj|«wxYw)zÄReplace 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.
ú/r)Úsuffix)rnr‰rrNÚjoinÚzipfileÚ
is_zipfileÚZipFileÚnamelistÚsplitextÚtempfileÚmkstempÚwriteÚreadÚclose)r‰ÚarchiveÚmemberÚprefixÚzip_filer£ÚfdÚextracted_paths rYÚextract_zipped_pathsrµ"s;ô

‡ww‡~~àˆ ô—gg—m‘m DÓ)O€Gˆ
œ"Ÿ'™'Ÿ.™.¨ÔŸ'™'Ÿ-™-¨Ó0‰ˆÙð
ؘ6 6Ðñ
œ"Ÿ'™'Ÿ.™.¨Õ × Ñ ˜gÔ ˆ ä˜'€HØ
X׈ ôW‰W×
Ñ
˜fŸl™l¨3ÓÑ
4°RÑ
8€FÜÔ€BˆðÜ
X—]] 
Œ à Ðøô  ús Å
%F Æ F c#óJKtjtjj |«¬«\}} tj
|d«5}|ddd«tj ||«y#1swYŒ xYw#t$rtj|«wxYw­w)z-Write a file to the disk in an atomic fashion)ÚdirÚwbN) rªrnr‰ÚdirnameÚfdopenrPÚ
BaseExceptionÚremove)ÚfilenameÚtmp_descriptorÚtmp_nameÚ tmp_handlers rYÚ atomic_openrÁHs†èø€ô/´B·G±G·O±OÀHÓ4MÔ€NÜ
Y‰Y~ 
 ° ØÒ ÷ ä
8˜ ð ûô òÜ
Ø
ðüs47B#ºBÁA4ÁBÁ3B#Á4A=Á9BÂ B Â B#cót|yt|ttttf«r t d«t
|«S)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)r^r!rÚboolrJrMr©Úvalues rYÚfrom_key_val_listrÇUs6ð(
€}Øä%œ#œu¤d¬CÐÐ  Ðr\cóy©Nrs rYÚto_key_val_listrÊrsØ*-r\cóyrs rYtsð r\cóÆ|yt|ttttf«r t d«t|t «rt|j««St|«S)Take 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Ã) r^r!rrJrMr_Úlistr`s rYxsPð&
€}Øä%œ#œu¤d¬CÐÐÔE—KK“MÓ r\cóg}t|«D]5}|dd|ddcxk(rdk(rnnt|dd«}|j|«Œ7|S)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_headerÚunquote_header_valueÚappend)ÚresultÚitems rYÚparse_list_headerrÕ˜sYð.€FÜ" ˆØ ˆ8t˜B˜C '  ¨Q¨r¨
Ó3ˆ
ðð €Mr\có¶i}t|«D]H}d|vrd||<Œ
|jdd«\}}|dd|ddcxk(rdk(rnnt|dd«}|||<ŒJ|S)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
ú=Nrr)rN)r™s rYÚparse_dict_headerrظs}ð,%'€FÜ" ˆØ d‰?؈F4‰LØ Ø—j‘j  aÓ(‰ ˆˆeØ !ˆ9˜˜b˜c˜
Ô ) cÕ ¨q°¨Ó5ˆE؈ˆtŠ ðð €Mr\có–|rF|d|dcxk(rdk(r5n|S|dd}|r|dddk7r"|jdd«jd d«S|S)
zçUnquotes 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
rrrNrkz\\ú\z\")rP)Ú is_filenames rYÛsdñ
q‘˜U 2™YÔ-¨#Ô €Lð ˆñ˜e B Q˜i¨6Ò—=‘= ¨Ó6°u¸ €Lr\cóX|Dcic]}|j|jŒ}}|Scc}w)z€Returns a key/value dictionary from a CookieJar.
:param cj: CookieJar object to extract cookies from.
:rtype: dict
)r™)ÚcjÚcookieÚ cookie_dicts rYÚdict_from_cookiejarràôs/ð<>Ö6—;; § ¡ Ñ>€KÐ Ðùò?s'cót||«S)zÂReturns 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&)s rYÚadd_dict_to_cookiejarrâÿsô ˜{¨BÓ /r\có^tjdt«tjdtj
¬«}tjdtj
¬«}tjd«}|j
|«|j
|«z|j
|«zS)zlReturns encodings from given content string.
:param content: bytestring to extract encodings from.
z¤In 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!<meta.*?charset=["\']*(.+?)["\'>])Úflagsz+<meta.*?content=["\']*;?charset=(.+?)["\'>]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])rrrsÚDeprecationWarningrQÚcompilerSÚfindall)ÚcontentÚ
charset_reÚ pragma_reÚxml_res rYÚget_encodings_from_contentrì
sô

‡M
 ô
ôÐÏÉÔM€JÜ
ÐIÔQS×QUÑQUÔV€IÜ
Z‰ZÐ
@€Fð ×ј7Ó
×
Ñ
˜

.‰.˜Ó
r\cóB|jd«}|dj«|dd}}i}d}|D]j}|j«}|sŒ|jd«x}dk7sŒ-|d|j|«}||dzdj|«} | ||j«<Œl||fS)z¨Returns content type and parameters from given header.
:param header: string
:return: tuple containing content type and dictionary of
parameters.
rBrrNz"' r×r)rNÚstripÚfindÚlower)
ÚheaderÚtokensÚ content_typeÚparamsÚ params_dictÚ strip_charsÚparamÚidxÚkeyrÆs
rYÚ_parse_content_type_headerrú#ð\‰\˜#Ó
€FØ! !™9Ÿ?™?Ó,¨f°Q°R¨j&€LØ)+€KØ€KàòØ
ˆÚ ˜UŸZ™Z¨›_Ð,Ó˜˜# 0ˆ˜# ™'˜$×*¨;Ó7ˆEØ',ˆK˜Ÿ ™ Ò  ˜Ð $r\cóŒ|jd«}|syt|«\}}d|vr|djd«Sd|vryd|vryy) z}Returns encodings from given HTTP Header Dict.
:param headers: dictionary to extract encoding from.
:rtype: str
z content-typeNÚcharsetz'"Útextz
ISO-8859-1zapplication/jsonrd)rˆ)Úheadersrós rYÚget_encoding_from_headersrÿ9s`ð—;‘;˜~Ó.€Lá Øä5°lÓ€LØ ×& 
ÑØà˜\Ñð*r\c#óüK|j |Ed{ytj|j«d¬«}|D]}|j|«}|sŒ|Œ|jdd¬«}|r|yy7Œe­w)zStream decodes an iterator.NrP©Úerrorsr\T)Úfinal)ÚencodingÚcodecsÚgetincrementaldecoderr†)ÚiteratorÚdecoderÚchunkÚrvs rYÚstream_decode_response_unicoder Rs„èø€ð
 ‡zØ×ÐØà6Œf×*¨1¯:©:Ó6¸iÔH€GØòˆØ
^‰^˜
"ˆÚ
Øð
˜ 4ˆÓ (€BÙ Øð
ð úsA<A:•AA<Á"A<cóyr©ÚstringÚ slice_lengths rYÚ iter_slicesresð$'r\cóyrrs rYrrisð"%r\c#óŽKd}||dkr t|«}|t|«kr||||z||z
}|t|«krŒyy­w)z Iterate over slices of a string.rN)rf)rrÚposs rYrrmsYèø€ð €CØÐ˜|¨qÒ˜6“{ˆ Ø
F“ Ò
ØS˜3 Ñ ˆ|шð F“ Õ
ùs AAÁAcó`tjdt«|jyg}t |j
«}|r t
|j|«S t
|j|xsdd¬«S#t$r|j|«YŒ9wxYw#t$r|jcYSwxYw)zâReturns 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
z£In 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.)NrdrPr)
rrrsrÿr!Ú UnicodeErrorrÒÚ TypeError)rÚtried_encodingsrs rYÚget_unicode_from_responserys­ô
‡M
 ô
ð ‡yØà!#€Oô¯©Ó3€Háðq—yy 
Ü1—99˜1¨'¸Døô ò × "   -ûô òØy‰yÒðús$ÁA5ÁBÁ5BÂBÂB-Â,B-zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~ÚUNRESERVED_SETcó†|jd«}tdt|««D]l}||dd}t|«dk(rI|j«r9 t t |d««}|tvr|||ddz||<ŒVd||||<Œbd||||<Œnd j|«S#t $rtd|d«wxYw)
z¨Un-escape any percent-escape sequences in a URI that are unreserved
characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
:rtype: str
ú%rrrkéz"Invalid percent-escape sequence: 'ú'Nr…)
rNÚrangerfÚisalnumÚchrrJrMr*r)ÚuriÚpartsÚcs rYÚunquote_unreservedr'¨ð
I‰IcN€EÜ
1”c˜%“jÓ
&ˆØ !‰HQqˆMˆÜ ˆq6QŠ;˜1Ÿ9™9œ;ð
LÜœ˜A˜r
“Oð”Nјu Q™x¨¨˜+aà˜u Q™x˜j˜>aà˜5 ™8˜*~ˆE!ŠHð
 7‰75øôò
LÜ Ð#EÀaÀSÈÐ!JÓ
Lús ÁB'Â'Ccópd}d} tt|«|¬«S#t$rt||¬«cYSwxYw)z¬Re-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)r r'r*)r"Úsafe_with_percentÚsafe_without_percents rYÚ requote_urir,ÀsJðØð ÔÓ,Ð3DÔEøÜ ò5ús œ5´5c
órtjdtj|««d}|j d«\}}tjdtjt t
|««««d}tjdtj|««d|z}||z||zk(S)zïThis 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=Lr)ÚstructÚunpackÚsocketÚ inet_atonrNÚdotted_netmaskrJ)ÚipÚnetÚipaddrÚnetaddrÚbitsÚnetmaskÚnetworks rYÚaddress_in_networkr:Ös˜ô]‰]˜×!1Ñ!1°"Ó!5Ó
6°qÑ
9€FØ—I‘I˜c“NM€Gˆm‰m˜D¤&×"2Ñ"2´>Ä#ÀdÃ)Ó3LÓ"MÓNÈqÑQ€GÜm‰m˜D¤&×"2Ñ"2°7Ó";Ó<¸?À'ÑI€GØ   '¨GÑ"3Ñ 4r\cópddd|z
zdz
z }tjtjd|««S)zConverts mask from /xx format to xxx.xxx.xxx.xxx
Example: if mask is 24 function returns 255.255.255.0
:rtype: str
lÿÿré z>I)r0Ú inet_ntoar.Úpack)Úmaskr7s rYr2r2ås7𠘘b 4™i™¨1Ñ ,€DÜ × Ñ œFŸK™K¨¨dÓ 4r\cóN tj|«y#t$rYywxYw)z
:rtype: bool
FT)r0r1rL)Ú string_ips rYÚis_ipv4_addressrBðs.ðÜ×Ñ˜Ô øô òÙðús ˜ $£$có |jd«dk(rR t|jd«d«}|dks|dkDry t j
|jd«d«yy#t$rYywxYw#t $rYywxYw)zV
Very simple check of the cidr format in no_proxy variable.
:rtype: bool
rFr<rT)ÚcountrJrNrMr0r1rL)Ústring_networkr?s rYÚ
is_valid_cidrrFûð ×јCÓ  AÒ Ü+¨CÓÑ4ˆDð !Š8t˜b’yØð Ü × Ñ ˜^×1°#Ó6°qÑ
ðøôò Ùð ûôò Ùð ús"A(¿'A7Á( A4Á3A4Á7 BÂBc#ó<K|du}d}|r2tjj|«}|tj|< d|r(|tj|=y|tj|<yy#|r(|tj|=w|tj|<wwxYw­w)zÎSet 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)rnr‡rˆ)Úenv_namerÆÚ
value_changedÚ old_values rYÚ set_environrKsèø€ð Ð%€MØ €IÙÜ—J‘J—N‘N 8Ó,ˆ Ø
ð
á ØÐ Ü—J‘J˜xÑ(à'0”
˜8Ò ø‰=ØÐ Ü—JJ˜(à'0”
˜ üs;B¾A-Á+BÁ-,BÂBcód d}|}||d«}t|«}|j}|y|rÉd|jdd«jd«D«}t |«r)|D]#}t |«rt
||«sŒy||k(sŒ#ynm|}|jr|d |jz
}|D]H} | jd
«} || k(s|| k(ryd
| z} |j| «s|j| «sŒHytd|«5 t|«}
ddd«
ryy #ttjf$rd }
YŒ)wxYw#1swYŒ.xYw)
zL
Returns whether we should bypass proxies or not.
:rtype: bool
cóžtjj|«xs-tjj|j««S)rnr‡rˆÚupper)s rYÚ get_proxyz(should_bypass_proxies.<locals>.get_proxy3s-Üz‰z~‰~˜A¤b§j¡j§n¡n°S·Y±Y³[Ó&AÐAr\no_proxyTc3ó&K|] }|sŒ|Œ y­wr)r€rTs rYrz(should_bypass_proxies.<locals>.<genexpr>Esèø€ÒX 4ÒSWœ$ÑXùsŠú r…ú:rCF)r!Úreturnú
str | None)r#rPrNrBrFr:ÚportÚlstripÚendswithrKrrr0Úgaierror) rrPrOÚ no_proxy_argÚparsedrŒÚno_proxy_hostsÚproxy_ipÚhost_with_portrTÚbypasss rYÚshould_bypass_proxiesra*snóBð
€LØÐÙ˜ZÓÜ
c‹]€FØ€HàÐàáñY¨8×+;Ñ+;¸Ó+D×+JÑ+JÈ3Ó+OÔXˆä ˜ 
Ü  Ô)¨(°HÕ Ó ñ
ð&ˆ{Š{Ø A f§k¡k ]Ð"3Ñ3à
Ø—{{ 'ؘ# ~¸Ò'=ÙØ˜TzØ×$ *¨n×.EÑ.EÀdÕ.KÙð

ô
Z Ó .ñð Ü! (Ó+ˆF÷ñ Øà øô
œ6Ÿ?™?Ð ØŠFð ú÷ðús*ÄD<Ä DÄD9Ä6D<Ä8D9Ä9D<Ä<Ecó4t||¬«riSt«S)zA
Return a dict of environment proxies.
:rtype: dict
©rP)rar)rrPs rYÚget_environ_proxiesrdisô ˜S¨8Õˆ ä‹|Ðr\có.|xsi}t|«}|j€+|j|j|jd««S|jdz|jz|jd|jzdg}d}|D]}||vsŒ||}|S|S)z­Select 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
allz://zall://)r#rˆÚscheme)rÚproxiesÚurlpartsÚ
proxy_keysÚproxyÚ proxy_keys rYÚ select_proxyrmuð Šm˜€Gܘ‹}€HØ×ÑÐ Ø{‰{˜8Ÿ?™?¨G¯K©K¸Ó,>Ó ˜ (×"3Ñ"3ÑØ8×
ð €Jð