Ë
    ”U.jÒ€  ã                   óV  — d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZ ddlmZmZ ddlmZ ddlmZ ddlmZmZmZmZ dd	lmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' dd
lm(Z) ddl*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2 dZ3 ejh                  «       Z5dddœZ6djo                   ejp                  d ed¬«      d   «      «      Z9ejt                  dk(  rd„ Z;d„ Z!d„ Z<d„ Z=dGd„Z>d„ Z?d„ Z@ej‚                  d„ «       ZBd „ ZCd!„ ZDd"„ ZEd#„ ZFdGd$„ZGd%„ ZHd&„ ZId'„ ZJd(„ ZKd)„ ZLd*„ ZMd+„ ZNd,„ ZO ePd-«      ZQd.„ ZRd/„ ZSd0„ ZTd1„ ZUd2„ ZVd3„ ZWej‚                  d4„ «       ZXd5„ ZYdHd6„ZZd7„ Z[dId8„Z\dJd9„Z]d:„ Z^d;„ Z_d<jÁ                  d=«      Zaead>z  Zbead?z  Zcd@„ ZddA„ ZedB„ ZfdC„ ZgdD„ ZhdE„ ZidF„ Zjy)Kz”
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_STRÚHEADER_VALIDATORSÚto_native_string)ÚMappingÚ
basestringÚ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)z.netrcÚ_netrcéP   i»  )ÚhttpÚhttpsz, z,\s*T)Úaccept_encodingzaccept-encodingÚwin32c                 ó  — 	 dd l }	 |j                  |j                  d«      }t	        |j                  |d«      d   «      }|j                  |d«      d   }|r|sy|j                  d«      }t        d |«      }|D ]j  }|dk(  rd| vr y	|j                  dd
«      }|j                  dd«      }|j                  dd«      }t        j                  || t        j                  «      sŒj y	 y# t        $ r Y yw xY w# t        t        f$ r Y yw xY w)Nr   Fz;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)Úhostr1   ÚinternetSettingsÚproxyEnableÚproxyOverrideÚtests         ú\C:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\pip/_vendor/requests/utils.pyÚproxy_bypass_registryrE   L   s   € ð	Ûð
	Ø%Ÿ~™~Ø×(Ñ(ØNó Ðô
 ˜f×1Ñ1Ð2BÀMÓRÐSTÑUÓVˆKà"×/Ñ/Ð0@À/ÓRÐSTÑUˆMñ ¡-Øð
 &×+Ñ+¨CÓ0ˆä˜t ]Ó3ˆã!ˆDØ�yÒ Ø˜d‘?ÙØ—<‘<  UÓ+ˆDØ—<‘<  UÓ+ˆDØ—<‘<  TÓ*ˆDÜ�x‰x˜˜d¤B§D¡DÕ)Ùð "ð øôC ò 	Ùð	ûô œÐ$ò 	Ùð	ús#   ‚C( ‡AC7 Ã(	C4Ã3C4Ã7D	ÄD	c                 óB   — t        «       rt        | «      S t        | «      S )zšReturn True, if the host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or the registry.
        )r   r   rE   )r?   s    rD   r   r   r   s    € ô "Ô#Ü+¨DÓ1Ð1ä(¨Ó.Ð.ó    c                 ó>   — t        | d«      r| j                  «       } | S )z/Returns an internal sequence dictionary update.Úitems)ÚhasattrrI   )Úds    rD   Údict_to_sequencerL   ~   s   € ô ˆq�'ÔØ�G‰G‹Iˆà€HrG   c                 óö  — d }d}t         s!t        | t        «      r| j                  d«      } t	        | d«      rt        | «      }n~t	        | d«      r| j
                  }net	        | d«      rY	 | j                  «       }t        j                  |«      j                  }d| j                  vrt        j                  dt        «       	 t	        | d«      rW	 | j#                  «       }t	        | d	«      r:|€8	 | j%                  dd
«       | j#                  «       }| j%                  |xs d«       |€d}t)        d||z
  «      S # t        j                  t         f$ r Y Œ‘w xY w# t&        $ r d}Y Œ?w xY w# t&        $ r |�|}Y ŒRw xY w)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é   )r   Ú
isinstancer   ÚencoderJ   rP   rQ   ÚosÚfstatÚst_sizeÚmodeÚwarningsÚwarnr   ÚioÚUnsupportedOperationÚAttributeErrorrS   rT   r7   Úmax)ÚoÚtotal_lengthÚcurrent_positionrQ   s       rD   Ú	super_lenre   ‡   sy  € Ø€LØÐåœJ q¬#Ô.ð �H‰H�WÓˆäˆq�)ÔÜ˜1“v‰ä	��EÔ	Ø—u‘u‰ä	��HÔ	ð	Ø—X‘X“ZˆFô Ÿ8™8 FÓ+×3Ñ3ˆLð ˜!Ÿ&™&Ñ Ü—‘ð2ô $õ
ô ˆq�&Ôð	%Ø Ÿv™v›xÐô �q˜&Ô! lÐ&:ð	%à—F‘F˜1˜a”LØ#$§6¡6£8�Lð —F‘FÐ+Ò0¨qÔ1ð ÐØˆäˆq�,Ð!1Ñ1Ó2Ð2øôe ×'Ñ'¬Ð8ò 	ñ ð		ûôX ò %Ø#$’Lð%ûô% ò 	0ð
 Ð'Ø#/Ð ùð	0ús6   Á*D8 ÃE( Ã.7E Ä8EÅEÅE%Å$E%Å(E8Å7E8c                 ó  — t         j                  j                  d«      }|�|f}nd„ t        D «       }	 ddlm}m} d}|D ]D  }t         j                  j                  |«      }t         j                  j                  |«      sŒB|} n |€yt        | «      }	|	j                  }
	  ||«      j                  |
«      }|rt        |«      r|d   rdnd}||   |d   fS yy# |t        f$ r |r‚ Y yw xY w# t        t        f$ r Y yw xY w)z;Returns the Requests tuple auth for a given url from netrc.ÚNETRCNc              3   ó&   K  — | ]	  }d |› �–— Œ y­w)z~/N© )Ú.0Úfs     rD   Ú	<genexpr>z!get_netrc_auth.<locals>.<genexpr>Õ   s   è ø€ Ð9©[¨˜R ˜sœ8©[ùs   ‚r   )ÚNetrcParseErrorÚnetrcr   rU   )rX   ÚenvironÚgetÚNETRC_FILESrn   rm   ÚpathÚ
expanduserÚexistsr   ÚhostnameÚauthenticatorsÚanyr7   r2   r`   )ÚurlÚraise_errorsÚ
netrc_fileÚnetrc_locationsrm   rn   Ú
netrc_pathrk   ÚlocÚrir?   r$   Úlogin_is                rD   Úget_netrc_authr€   Î   s  € ô —‘—‘ Ó(€JØÐØ%˜-‰á9­[Ó9ˆð ß0àˆ
ã ˆAÜ—'‘'×$Ñ$ QÓ'ˆCÜ�w‰w�~‰~˜cÕ"Ø �
Ùð	 !ð ÐØä�c‹]ˆØ�{‰{ˆð
	Ù˜:Ó&×5Ñ5°dÓ;ˆFÙœ#˜fœ+à% ašy™!¨a�Ø˜w™¨°©Ð3Ð3ð &ˆvøð  ¤Ð)ò 	ñ Øñ ð	ûô œÐ(ò Ùðús<   ´AC/ ÂC/ Â
C/ Â"6C ÃC,Ã)C/ Ã+C,Ã,C/ Ã/DÄ Dc                 ó¦   — t        | dd«      }|rBt        |t        «      r1|d   dk7  r(|d   dk7  rt        j                  j                  |«      S yyyy)z0Tries to guess the filename of the given object.ÚnameNr   Ú<éÿÿÿÿÚ>)ÚgetattrrV   r   rX   rr   Úbasename)Úobjr‚   s     rD   Úguess_filenamer‰   ú   sT   € ä�3˜ Ó%€DÙ”
˜4¤Ô,°°a±¸C²ÀDÈÁHÐPSÂOÜ�w‰w×Ñ Ó%Ð%ð ET°Ð,€trG   c                 óF  — t         j                  j                  | «      r| S t         j                  j                  | «      \  }}|ryt         j                  j                  |«      sZt         j                  j                  |«      \  }}|sn5dj	                  ||g«      }|r t         j                  j                  |«      sŒZt        j                  |«      s| S t        j                  |«      }||j                  «       vr| S t         j                  j                  |j                  d«      d   «      d   }t        j                  |¬«      \  }}	 t        j                  ||j                  |«      «       t        j                  |«       |S # t        j                  |«       w xY w)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)rX   rr   rt   r9   ÚjoinÚzipfileÚ
is_zipfileÚZipFileÚnamelistÚsplitextÚtempfileÚmkstempÚwriteÚreadÚclose)rr   ÚarchiveÚmemberÚprefixÚzip_filerŒ   ÚfdÚextracted_paths           rD   Úextract_zipped_pathsrž     s;  € ô
 
‡w�w‡~�~�dÔàˆô —g‘g—m‘m DÓ)�O€GˆVÙ
œ"Ÿ'™'Ÿ.™.¨Ô1ÜŸ'™'Ÿ-™-¨Ó0‰ˆ�Ùð Ø—‘˜6 6Ð*Ó+ˆñ œ"Ÿ'™'Ÿ.™.¨Õ1ô ×Ñ˜gÔ&Øˆä�‰˜wÓ'€HØ�X×&Ñ&Ó(Ñ(Øˆô �W‰W×Ñ˜fŸl™l¨3Ó/°Ñ3Ó4°RÑ8€FÜ!×)Ñ)°Ô8Ñ€BˆðÜ
�‰��X—]‘] 6Ó*Ô+ä
�‰�ŒàÐøô 	�‰��ús   Å%F	 Æ	F c              #   óJ  K  — t        j                  t        j                  j	                  | «      ¬«      \  }}	 t        j
                  |d«      5 }|–— ddd«       t        j                  || «       y# 1 sw Y   Œ xY w# t        $ r t        j                  |«       ‚ w xY w­w)z-Write a file to the disk in an atomic fashion)ÚdirÚwbN)	r“   r”   rX   rr   ÚdirnameÚfdopenr;   ÚBaseExceptionÚremove)ÚfilenameÚtmp_descriptorÚtmp_nameÚtmp_handlers       rD   Úatomic_openrª   '  s   è ø€ ô  (×/Ñ/´B·G±G·O±OÀHÓ4MÔNÑ€N�HðÜ�Y‰Y�~ tÔ,°ØÒ÷ -ä
�
‰
�8˜XÕ&÷ -Ð,ûô ò Ü
�	‰	�(ÔØðüs4   ‚7B#ºB  ÁA4ÁB  Á3B#Á4A=Á9B  Â  B Â B#c                 ót   — | €yt        | t        t        t        t        f«      rt        d«      ‚t        | «      S )a  Take 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)rV   r   r   Úboolr5   r8   r   ©Úvalues    rD   Úfrom_key_val_listr°   4  s6   € ð$ €}Øä�%œ#œu¤d¬CÐ0Ô1ÜÐFÓGÐGä�uÓÐrG   c                 ó´   — | €yt        | t        t        t        t        f«      rt        d«      ‚t        | t        «      r| j                  «       } t        | «      S )aÂ  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¬   )	rV   r   r   r­   r5   r8   r   rI   Úlistr®   s    rD   Úto_key_val_listr³   O  sJ   € ð" €}Øä�%œ#œu¤d¬CÐ0Ô1ÜÐFÓGÐGä�%œÔ!Ø—‘“ˆä�‹;ÐrG   c                 ó�   — g }t        | «      D ]5  }|dd |dd cxk(  rdk(  rn nt        |dd «      }|j                  |«       Œ7 |S )a  Parse 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
    Nr   r„   Ú")Ú_parse_list_headerÚunquote_header_valueÚappend)r¯   ÚresultÚitems      rD   Úparse_list_headerr»   m  sT   € ð. €FÜ" 5Ö)ˆØ��ˆ8�t˜B˜C�yÔ' CÕ'Ü'¨¨Q¨r¨
Ó3ˆDØ�‰�dÕð *ð €MrG   c                 ó¶   — i }t        | «      D ]H  }d|vrd||<   Œ|j                  dd«      \  }} | dd | dd cxk(  rdk(  rn nt        | dd «      } | ||<   Œ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
    Ú=Nr   r„   rµ   )r¶   r9   r·   )r¯   r¹   rº   r‚   s       rD   Úparse_dict_headerr¾   �  sx   € ð, €FÜ" 5Ö)ˆØ�d‰?ØˆF�4‰LØØ—j‘j  aÓ(‰ˆˆeØ��!ˆ9˜˜b˜c˜
Ô) cÕ)Ü(¨¨q°¨Ó5ˆEØˆˆtŠð *ð €MrG   c                 ó–   — | rF| d   | d   cxk(  rdk(  r5n | S | dd } |r| dd dk7  r"| j                  dd«      j                  d	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
    r   r„   rµ   r   NrU   z\\Ú\z\")r;   )r¯   Úis_filenames     rD   r·   r·   °  sd   € ñ ��q‘˜U 2™YÔ-¨#Ô-ð €Lð �a˜�ˆñ ˜e B Q˜i¨6Ò1Ø—=‘= ¨Ó.×6Ñ6°u¸cÓBÐBØ€LrG   c                 óX   — | D �ci c]  }|j                   |j                  “Œ }}|S c c}w )z€Returns a key/value dictionary from a CookieJar.

    :param cj: CookieJar object to extract cookies from.
    :rtype: dict
    )r‚   r¯   )ÚcjÚcookieÚcookie_dicts      rD   Údict_from_cookiejarrÆ   É  s0   € ñ <>Ó>¹2°�6—;‘; §¡Ñ,¸2€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   )rÃ   rÅ   s     rD   Úadd_dict_to_cookiejarrÈ   Ô  s   € ô ˜{¨BÓ/Ð/rG   c                 ó^  — t        j                  dt        «       t        j                  dt        j
                  ¬«      }t        j                  dt        j
                  ¬«      }t        j                  d«      }|j                  | «      |j                  | «      z   |j                  | «      z   S )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=["\']*(.+?)["\'>])r\   r]   ÚDeprecationWarningr<   Úcompiler>   Úfindall)ÚcontentÚ
charset_reÚ	pragma_reÚxml_res       rD   Úget_encodings_from_contentrÒ   ß  s‘   € ô
 ‡M�Mð1ô 	ôô —‘Ð@ÌÏÉÔM€JÜ—
‘
ÐIÔQS×QUÑQUÔV€IÜ�Z‰ZÐ?Ó@€Fð 	×Ñ˜7Ó#Ø
×
Ñ
˜GÓ
$ñ	%à
�.‰.˜Ó
!ñ	"ðrG   c                 óB  — | j                  d«      }|d   j                  «       |dd }}i }d}|D ]j  }|j                  «       }|sŒ|j                  d«      x}dk7  sŒ-|d| j                  |«      }||dz   d j                  |«      }	|	||j                  «       <   Œl ||fS )z¨Returns content type and parameters from given header.

    :param header: string
    :return: tuple containing content type and dictionary of
         parameters.
    r-   r   r   Nz"' r½   r„   )r9   ÚstripÚfindÚlower)
ÚheaderÚtokensÚcontent_typeÚparamsÚparams_dictÚstrip_charsÚparamÚidxÚkeyr¯   s
             rD   Ú_parse_content_type_headerrà   ø  s°   € ð �\‰\˜#Ó€FØ! !™9Ÿ?™?Ó,¨f°Q°R¨j�&€LØ€KØ€KãˆØ—‘“ˆÚ˜UŸZ™Z¨›_Ð,�c°Ó3Ø˜˜�+×#Ñ# KÓ0ˆCØ˜# ™'˜)Ð$×*Ñ*¨;Ó7ˆEØ',ˆK˜Ÿ	™	›Ò$ð ð ˜Ð$Ð$rG   c                 óŒ   — | j                  d«      }|syt        |«      \  }}d|v r|d   j                  d«      S d|v ryd|v ryy)	z}Returns encodings from given HTTP Header Dict.

    :param headers: dictionary to extract encoding from.
    :rtype: str
    zcontent-typeNÚcharsetz'"Útextz
ISO-8859-1zapplication/jsonrN   )rp   rà   rÔ   )ÚheadersrÙ   rÚ   s      rD   Úget_encoding_from_headersrå     s`   € ð —;‘;˜~Ó.€LáØä5°lÓCÑ€L�&à�FÑØ�iÑ ×&Ñ& uÓ-Ð-à�ÑØà˜\Ñ)àð *rG   c              #   óü   K  — |j                   €| E d{  –—†  y t        j                  |j                   «      d¬«      }| D ]  }|j                  |«      }|sŒ|–— Œ |j                  dd¬«      }|r|–— yy7 Œe­w)zStream decodes an iterator.Nr;   ©ÚerrorsrG   T)Úfinal)ÚencodingÚcodecsÚgetincrementaldecoderÚdecode)ÚiteratorÚrÚdecoderÚchunkÚrvs        rD   Ústream_decode_response_unicoderó   '  s   è ø€ ð 	‡z�zÐØ×ÐØà6Œf×*Ñ*¨1¯:©:Ó6¸iÔH€GÛˆØ�^‰^˜EÓ"ˆÚØ‹Hð ð 
�‰˜ 4ˆÓ	(€BÙ	Ø‹ð 
ð 	ús   ‚A<”A:•AA<Á"A<c              #   óŽ   K  — d}|�|dk  rt        | «      }|t        | «      k  r| |||z    –— ||z  }|t        | «      k  rŒyy­w)z Iterate over slices of a string.r   N)rP   )ÚstringÚslice_lengthÚposs      rD   Úiter_slicesrø   8  sW   è ø€ à
€CØÐ˜|¨qÒ0Ü˜6“{ˆØ
”�F“Ò
Ø�S˜3 Ñ-Ð.Ò.Øˆ|Ñˆð ”�F“Õ
ùs   ‚A AÁAc                 ó>  — t        j                  dt        «       g }t        | j                  «      }|r	 t        | j                  |«      S 	 t        | j                  |d¬«      S # t        $ r |j                  |«       Y Œ5w xY w# t        $ r | j                  cY S w xY w)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.)r;   rç   )
r\   r]   rË   rå   rä   r   rÎ   ÚUnicodeErrorr¸   Ú	TypeError)rï   Útried_encodingsrê   s      rD   Úget_unicode_from_responserý   B  s›   € ô ‡M�Mð1ô 	ôð €Oô )¨¯©Ó3€Háð	-Ü�q—y‘y (Ó+Ð+ð
Ü�1—9‘9˜h¨yÔ9Ð9øô ò 	-Ø×"Ñ" 8Ö,ð	-ûô ò Ø�y‰yÒðús#   µA$ ÁB Á$BÂ BÂBÂBzBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~c                 ó†  — | j                  d«      }t        dt        |«      «      D ]l  }||   dd }t        |«      dk(  rI|j                  «       r9	 t	        t        |d«      «      }|t        v r|||   dd z   ||<   ŒVd||   › �||<   Œbd||   › �||<   Œn d	j                  |«      S # t        $ r t        d|› d�«      ‚w xY w)
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
    Ú%r   r   rU   é   z"Invalid percent-escape sequence: 'Ú'NÚ )
r9   ÚrangerP   ÚisalnumÚchrr5   r8   r!   ÚUNRESERVED_SETr�   )ÚuriÚpartsÚiÚhÚcs        rD   Úunquote_unreservedr  o  sÝ   € ð �I‰I�c‹N€EÜ�1”c˜%“jÖ!ˆØ�!‰H�Q�qˆMˆÜˆq‹6�QŠ;˜1Ÿ9™9œ;ðLÜœ˜A˜r›
“O�ð ”NÑ"Ø˜u Q™x¨¨˜|Ñ+��a’à˜u Q™x˜j˜>��a’à˜5 ™8˜*�~ˆE�!ŠHð "ð �7‰7�5‹>Ðøô ò LÜ Ð#EÀaÀSÈÐ!JÓKÐKðLús   ÁB'Â'C c                 óp   — d}d}	 t        t        | «      |¬«      S # t        $ r t        | |¬«      cY S w xY w)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      rD   Úrequote_urir  ‡  sJ   € ð /ÐØ0Ðð	5ô Ô'¨Ó,Ð3DÔEÐEøÜò 5ô �SÐ3Ô4Ò4ð	5ús   † œ5´5c           
      ór  — t        j                  dt        j                  | «      «      d   }|j	                  d«      \  }}t        j                  dt        j                  t        t        |«      «      «      «      d   }t        j                  dt        j                  |«      «      d   |z  }||z  ||z  k(  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   r‹   )ÚstructÚunpackÚsocketÚ	inet_atonr9   Údotted_netmaskr5   )ÚipÚnetÚipaddrÚnetaddrÚbitsÚnetmaskÚnetworks          rD   Úaddress_in_networkr  �  s˜   € ô �]‰]˜4¤×!1Ñ!1°"Ó!5Ó6°qÑ9€FØ—I‘I˜c“N�M€GˆTÜ�m‰m˜D¤&×"2Ñ"2´>Ä#ÀdÃ)Ó3LÓ"MÓNÈqÑQ€GÜ�m‰m˜D¤&×"2Ñ"2°7Ó";Ó<¸QÑ?À'ÑI€GØ�WÑ '¨GÑ"3Ñ4Ð4rG   c                 óp   — ddd| z
  z  dz
  z  }t        j                  t        j                  d|«      «      S )z�Converts 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)r  Ú	inet_ntoar  Úpack)Úmaskr  s     rD   r  r  ¬  s7   € ð ˜˜b 4™i™¨1Ñ,Ñ,€DÜ×ÑœFŸK™K¨¨dÓ3Ó4Ð4rG   c                 óN   — 	 t        j                  | «       y# t        $ r Y yw xY w)z
    :rtype: bool
    FT)r  r  r7   )Ú	string_ips    rD   Úis_ipv4_addressr'  ·  s.   € ðÜ×Ñ˜Ô#ð øô ò Ùðús   ‚ ˜	$£$c                 ó  — | j                  d«      dk(  rR	 t        | j                  d«      d   «      }|dk  s|dkD  ry	 t	        j
                  | j                  d«      d   «       yy# t        $ r Y yw xY w# t        $ r Y yw xY w)zV
    Very simple check of the cidr format in no_proxy variable.

    :rtype: bool
    r‹   r   Fr!  r   T)Úcountr5   r9   r8   r  r  r7   )Ústring_networkr$  s     rD   Úis_valid_cidrr+  Â  sœ   € ð ×Ñ˜CÓ  AÒ%ð	Ü�~×+Ñ+¨CÓ0°Ñ3Ó4ˆDð �!Š8�t˜b’yØð	Ü×Ñ˜^×1Ñ1°#Ó6°qÑ9Ô:ð
 ð øô ò 	Ùð	ûô ò 	Ùð	ús"   –A( ¿'A7 Á(	A4Á3A4Á7	BÂBc              #   ó8  K  — |du}|r2t         j                  j                  | «      }|t         j                  | <   	 d–— |r(€t         j                  | = y|t         j                  | <   yy# |r(€t         j                  | = w |t         j                  | <   w w xY w­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)rX   ro   rp   )Úenv_namer¯   Úvalue_changedÚ	old_values       rD   Úset_environr0  Ú  s�   è ø€ ð  Ð%€MÙÜ—J‘J—N‘N 8Ó,ˆ	Ø$Œ�
‰
�8Ñð1ÛáØÐ Ü—J‘J˜xÑ(à'0”—
‘
˜8Ò$ð	 ø‰=ØÐ Ü—J‘J˜xÑ(à'0”—
‘
˜8Ò$ð	 üs   ‚9B¼A+ Á +BÁ+,BÂBc                 ó¾  — d„ }|}|€ |d«      }t        | «      }|j                  €y|rÙd„ |j                  dd«      j                  d«      D «       }t	        |j                  «      r=|D ]7  }t        |«      rt        |j                  |«      sŒ% y|j                  |k(  sŒ7 y n_|j                  }|j                  r|d	|j                  › �z  }|D ]0  }|j                  j                  |«      s|j                  |«      sŒ0 y t        d|«      5  	 t        |j                  «      }ddd«       ryy
# t        t        j                  f$ r d
}Y Œ)w xY w# 1 sw Y   Œ.xY w)zL
    Returns whether we should bypass proxies or not.

    :rtype: bool
    c                 óž   — t         j                  j                  | «      xs- t         j                  j                  | j                  «       «      S ©N)rX   ro   rp   Úupper)rß   s    rD   Ú	get_proxyz(should_bypass_proxies.<locals>.get_proxyù  s-   € Ü�z‰z�~‰~˜cÓ"ÒA¤b§j¡j§n¡n°S·Y±Y³[Ó&AÐArG   NÚno_proxyTc              3   ó&   K  — | ]	  }|sŒ|–— Œ y ­wr3  ri   )rj   r?   s     rD   rl   z(should_bypass_proxies.<locals>.<genexpr>
  s   è ø€ ÐRÑ%I˜TÊT”DÑ%Iùs   ‚ŠÚ r  Ú,Ú:F)r   ru   r;   r9   r'  r+  r  ÚportÚendswithr0  r   rû   r  Úgaierror)	rx   r6  r5  Úno_proxy_argÚparsedÚproxy_ipÚhost_with_portr?   Úbypasss	            rD   Úshould_bypass_proxiesrC  ð  sI  € òBð
 €LØÐÙ˜ZÓ(ˆÜ�c‹]€Fà‡�Ðàáñ S X×%5Ñ%5°c¸2Ó%>×%DÑ%DÀSÔ%IÓRˆä˜6Ÿ?™?Ô+Û$�Ü  Ô*Ü)¨&¯/©/¸8ÕDÙ#Ø—_‘_¨Ó0ñ  ñ %ð $Ÿ_™_ˆNØ�{Š{Ø A f§k¡k ]Ð"3Ñ3�ã �Ø—?‘?×+Ñ+¨DÔ1°^×5LÑ5LÈTÕ5Rñ  ð	 !ô 
�Z Õ	.ð	Ü! &§/¡/Ó2ˆF÷ 
/ñ Øàøô œ6Ÿ?™?Ð+ò 	ØŠFð	ú÷	 
/Ð	.ús*   ÄEÄD2Ä2EÅEÅEÅEÅEc                 ó4   — t        | |¬«      ri S t        «       S )zA
    Return a dict of environment proxies.

    :rtype: dict
    ©r6  )rC  r   )rx   r6  s     rD   Úget_environ_proxiesrF  -  s   € ô ˜S¨8Õ4Øˆ	ä‹|ÐrG   c                 ó.  — |xs i }t        | «      }|j                  €+|j                  |j                  |j                  d«      «      S |j                  dz   |j                  z   |j                  d|j                  z   dg}d}|D ]  }||v sŒ||   } |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
    NÚallz://zall://)r   ru   rp   Úscheme)rx   ÚproxiesÚurlpartsÚ
proxy_keysÚproxyÚ	proxy_keys         rD   Úselect_proxyrO  9  sª   € ð Šm˜€GÜ˜‹}€HØ×ÑÐ Ø�{‰{˜8Ÿ?™?¨G¯K©K¸Ó,>Ó?Ð?ð 	�‰˜%Ñ (×"3Ñ"3Ñ3Ø�‰Ø�8×$Ñ$Ñ$Øð	€Jð €EÛˆ	Ø˜ÒØ˜IÑ&ˆEØà€Lð  ð
 €LrG   c                 ó8  — |�|ni }| j                   }t        |«      j                  }|j                  d«      }|j	                  «       }|rOt        ||¬«      sBt        ||¬«      }|j                  ||j                  d«      «      }|r|j                  ||«       |S )a©  This method takes proxy information from a request and configuration
    input to resolve a mapping of target proxies. This will consider settings
    such as 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
    r6  rE  rH  )rx   r   rI  rp   ÚcopyrC  rF  Ú
setdefault)	ÚrequestrJ  Ú	trust_envrx   rI  r6  Únew_proxiesÚenviron_proxiesrM  s	            rD   Úresolve_proxiesrW  S  s�   € ð !Ð,‰g°"€GØ
�+‰+€CÜ�c‹]×!Ñ!€FØ�{‰{˜:Ó&€HØ—,‘,“.€KáÔ.¨s¸XÕFÜ-¨c¸HÔEˆà×#Ñ# F¨O×,?Ñ,?ÀÓ,FÓGˆáØ×"Ñ" 6¨5Ô1ØÐrG   c                 ó   — | › dt         › �S )zO
    Return a string representing the default user agent.

    :rtype: str
    r‹   r   )r‚   s    rD   Údefault_user_agentrY  n  s   € ð ˆV�1”[�MÐ"Ð"rG   c                  ó:   — t        t        «       t        dddœ«      S )z9
    :rtype: requests.structures.CaseInsensitiveDict
    z*/*z
keep-alive)z
User-AgentzAccept-EncodingÚAcceptÚ
Connection)r#   rY  ÚDEFAULT_ACCEPT_ENCODINGri   rG   rD   Údefault_headersr^  w  s%   € ô ä,Ó.Ü6ØØ&ñ		
óð rG   c                 óÄ  — g }d}| j                  |«      } | s|S t        j                  d| «      D ]Š  }	 |j                  dd«      \  }}d|j                  d«      i}|j                  d«      D ]:  }	 |j                  d«      \  }} | j                  |«      ||j                  |«      <   Œ< |j	                  |«       ŒŒ |S # t        $ r |d}}Y Œ…w xY w# t        $ r Y  Œ4w xY w)	z¼Return a list of parsed link headers proxies.

    i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"

    :rtype: list
    z '"z, *<r-   r   r  rx   z<> '"r½   )rÔ   r<   r9   r8   r¸   )	r¯   ÚlinksÚreplace_charsÚvalrx   rÚ   ÚlinkrÝ   rß   s	            rD   Úparse_header_linksrd  …  sñ   € ð €Eà€Mà�K‰K˜Ó&€EÙØˆä�x‰x˜ Ö&ˆð	"ØŸ)™) C¨Ó+‰KˆC�ð �s—y‘y Ó*Ð+ˆà—\‘\ #Ö&ˆEðØ"Ÿ[™[¨Ó-‘
��Uð .3¯[©[¸Ó-GˆD�—‘˜=Ó)Ò*ð 'ð 	�‰�TÕð! 'ð$ €Løô ò 	"Ø˜r�ŠCð	"ûô ò Úðús#   ´B?Á1CÂ?CÃCÃ	CÃCÚ ÚasciirU   é   c                 óŒ  — | dd }|t         j                  t         j                  fv ry|dd t         j                  k(  ry|dd t         j                  t         j
                  fv ry|j                  t        «      }|dk(  ry	|dk(  r |ddd…   t        k(  ry
|ddd…   t        k(  ry|dk(  r|dd t        k(  ry|dd t        k(  ryy)z
    :rtype: str
    Né   zutf-32rg  z	utf-8-sigrU   zutf-16r   rN   z	utf-16-ber   z	utf-16-lez	utf-32-bez	utf-32-le)
rë   ÚBOM_UTF32_LEÚBOM_UTF32_BEÚBOM_UTF8ÚBOM_UTF16_LEÚBOM_UTF16_BEr)  Ú_nullÚ_null2Ú_null3)ÚdataÚsampleÚ	nullcounts      rD   Úguess_json_utfru  °  sÕ   € ð �"�1ˆX€FØ”&×%Ñ%¤v×':Ñ':Ð;Ñ;ØØˆbˆq€z”V—_‘_Ò$ØØˆbˆq€z”f×)Ñ)¬6×+>Ñ+>Ð?Ñ?ØØ—‘œUÓ#€IØ�A‚~ØØ�A‚~Ø‘#�A�#‰;œ&Ò ØØ�!�$�Q�$‰<œ6Ò!Øà�A‚~Ø�"�1ˆ:œÒØØ�!�"ˆ:œÒØàrG   c                 ó¬   — t        | «      }|\  }}}}}}}	|j                  }
|
s||
}}
|rdj                  ||
g«      }
|€|}|€d}t        ||
|d||	f«      S )zªGiven 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  )r   Únetlocr�   r   )rx   Ú
new_schemer?  rI  Úauthr?   r;  rr   ÚqueryÚfragmentrx  s              rD   Úprepend_scheme_if_neededr}  Ð  s{   € ô �s‹^€FØ6<Ñ3€FˆD�$˜˜d E¨8ð �]‰]€FÙØ˜V�ˆáð —‘˜4 ˜.Ó)ˆØ€~ØˆØ€|Øˆä�v˜v t¨R°¸ÐAÓBÐBrG   c                 ó¢   — t        | «      }	 t        |j                  «      t        |j                  «      f}|S # t        t
        f$ r d}Y |S w xY w)z{Given a url with authentication components, extract them into a tuple of
    username,password.

    :rtype: (str,str)
    )r  r  )r   r   ÚusernameÚpasswordr`   rû   )rx   r?  rz  s      rD   Úget_auth_from_urlr�  í  sU   € ô �c‹]€FðÜ˜Ÿ™Ó(¬'°&·/±/Ó*BÐCˆð €Køô œIÐ&ò Ø‰à€Kðús   �*9 ¹AÁAc                 óB   — | \  }}t        | |d«       t        | |d«       y)z§Verifies that header parts don't contain leading whitespace
    reserved characters, or return characters.

    :param header: tuple, in the format (name, value).
    r   r   N)Ú_validate_header_part)r×   r‚   r¯   s      rD   Úcheck_header_validityr„  ý  s%   € ð �K€Dˆ%Ü˜& $¨Ô*Ü˜& %¨Õ+rG   c           
      óü   — t        |t        «      r
t        |   }n7t        |t        «      r
t        |   }nt        d|›d| › dt        |«      › �«      ‚|j                  |«      s|dk(  rdnd}t        d|› d|›�«      ‚y )	NzHeader part (z) from z# must be of type str or bytes, not r   r‚   r¯   zTInvalid leading whitespace, reserved character(s), or return character(s) in header z: )rV   r   r   r   r
   r    Útyper=   )r×   Úheader_partÚheader_validator_indexÚ	validatorÚheader_kinds        rD   rƒ  rƒ    s    € Ü�+œsÔ#Ü*Ð+AÑB‰	Ü	�K¤Ô	'Ü+Ð,BÑC‰	äØ˜K˜?¨'°&°ð :1Ü15°kÓ1BÐ0CðEó
ð 	
ð
 �?‰?˜;Ô'Ø 6¸!Ò ;‘fÀˆÜð&Ø&1 ]°"°[°OðEó
ð 	
ð (rG   c                 ó~   — t        | «      \  }}}}}}|s||}}|j                  dd«      d   }t        |||||df«      S )zW
    Given a url remove the fragment and the authentication part.

    :rtype: str
    rw  r   r„   r  )r   Úrsplitr   )rx   rI  rx  rr   rÚ   r{  r|  s          rD   Úurldefragauthr�    sU   € ô 5=¸S³MÑ1€FˆF�D˜& %¨ñ Ø˜V�ˆà�]‰]˜3 Ó" 2Ñ&€Fä�v˜v t¨V°U¸BÐ?Ó@Ð@rG   c                 óÖ   — t        | j                  dd«      }|�.t        | j                  t        «      r	  || j                  «       yt        d«      ‚# t
        $ r t        d«      ‚w xY w)zfMove file pointer back to its recorded starting position
    so it can be read again on redirect.
    rT   Nz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)r†   ÚbodyrV   Ú_body_positionr   r7   r"   )Úprepared_requestÚ	body_seeks     rD   Úrewind_bodyr“  ,  st   € ô Ð(×-Ñ-¨v°tÓ<€IØÐ¤Ø×'Ñ'¬ô"ð	ÙÐ&×5Ñ5Õ6ô $Ð$QÓRÐRøô ò 	Ü'ØMóð ð	ús   µA ÁA()Fr3  )T)zpython-requests)kÚ__doc__rë   Ú
contextlibr^   rX   r<   r  r  Úsysr“   r\   rŽ   Úcollectionsr   Úpip._vendor.urllib3.utilr   r   r  r   r	   Ú_internal_utilsr
   r   r   r   Úcompatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r¶   Úcookiesr   Ú
exceptionsr   r    r!   r"   Ú
structuresr#   rq   ÚwhereÚDEFAULT_CA_BUNDLE_PATHÚDEFAULT_PORTSr�   r9   r]  ÚplatformrE   rL   re   r€   r‰   rž   Úcontextmanagerrª   r°   r³   r»   r¾   r·   rÆ   rÈ   rÒ   rà   rå   ró   rø   rý   Ú	frozensetr  r  r  r  r  r'  r+  r0  rC  rF  rO  rW  rY  r^  rd  rW   ro  rp  rq  ru  r}  r�  r„  rƒ  r�  r“  ri   rG   rD   Ú<module>r¤     s  ðñó Û Û 	Û 	Û 	Û Û Û 
Û Û Û Ý #ç <å Ý $÷ó ÷÷ ÷ ÷ õ  :Ý (÷ó õ ,à"€ð %˜Ÿ™›Ð à cÑ*€ð Ÿ)™)Ø€B‡H�HˆW‘l°4Ô8Ð9JÑKÓLóÐ ð
 ‡<�<�7Òò$òL	/òòD3óN)òX&ò#ðL ×Ññ	ó ð	òò6ò<ò@óFò2ò0òò2%ò,ò2ò"ò$ñP ØMó€ò
ò05ò,5ò5òòð0 ×Ññ1ó ð1ò*:óz	òó4ó6#òò"ðL 	�‰�gÓ€Ø	�‰€Ø	�‰€òò@Cò:ò ,ò
ò&Aó"SrG   