o
    g}”e¢  ã                   @   s  d dl mZ d dlZd dlZd dlZzd dlZW n ey#   dZY nw ejd  dk rµd dlmZ e	fZ
eZd dlmZ d dlZd dlZddlmZ d dlmZ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# d
d„ Zd dl$Z$d dl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- er�d dl$m.Z. d dl/Z/d dl0Z0d dl1Z2d dl3m3Z3 d dl4Z4e5Z5d dl6m7Z8 d dl6m9Z: nˆd dl;mZ e<fZ
e<Zd dl;m=Z d dlZd dlZd dlZd dl>mZmZmZmZ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- e�rd dl?m.Z. d dl@m(Z(m'Z'm"Z" d dlAmBZ/ d dl?mCZ$ d dlDmBZ0 d dl2Z2d dlEm3Z3 d dlFmGZ4 eHZ5d dl6m:Z: e8Z8z
d dlmIZImJZJ W n e�yb   G dd„ deKƒZJdbdd„ZLdd„ ZIY nw zd dlmMZN W n e�y}   G dd„ deOƒZNY nw zd d lmPZP W n e�y›   ejQejRB dfd!d"„ZPY nw d d#lSmTZU eVeUd$ƒ�r«eUZTnd d%lSmWZX G d&d'„ d'eXƒZWG d(d)„ d)eUƒZTzd d*lYmZZZ W n e�y×   d+d,„ ZZY nw zd dl[Z[W n e�yî   dd-lm[Z[ Y nw ze\Z\W n e]�y   d d.l^m_Z_ d/d0„ Z\Y nw zej`Z`ejaZaW n# eb�y3   e c¡ �pd1Zdedd2k�r'd3Zend4Zed5d6„ Z`d7d8„ ZaY nw zd d9lfmgZg W n# e�y_   d d:lhmiZimjZj d dlZe kd;¡Zld<d=„ Zmd>d?„ ZgY nw zd d@lnmoZo W n e�yx   d d@lpmoZo Y nw ejddA… dBk �rˆe3ƒ jqZqnd dClnmqZq zd dDlrmsZs W n0 e�yÆ   d dElrmtZt zd dFlumvZw W n e�y»   dcdHdI„ZwY nw G dJdK„ dKetƒZsY nw zd dLlxmyZy W n" e�yñ   zd dLlzmyZy W n e�yî   dddMdN„ZyY nw Y nw zd dOlrm{Z{ W nB e�y<   zd dPl|m}Z~ W n e�y   d dPlm}Z~ Y nw zd dQl€m�Z�m‚Z‚mƒZƒ W n
 e�y1   Y nw G dRdS„ dSe„ƒZ{Y nw zd dTl…m†Z†m‡Z‡ W dS  e�yƒ   e kdUejˆ¡Z‰dVdW„ Z‡G dXdY„ dYe„ƒZŠdddZd[„Z‹G d\d]„ d]eŒƒZ�G d^d_„ d_eŽƒZ�G d`da„ daeOƒZ†Y dS w )eé    )Úabsolute_importNé   )ÚStringIO)ÚFileTypeé   )Úshutil)ÚurlparseÚ
urlunparseÚurljoinÚurlsplitÚ
urlunsplit)ÚurlretrieveÚquoteÚunquoteÚurl2pathnameÚpathname2urlÚContentTooShortErrorÚ	splittypec                 C   s   t | tƒr
|  d¡} t| ƒS )Núutf-8)Ú
isinstanceÚunicodeÚencodeÚ_quote)Ús© r   úc/Users/abhinavbhinder/Documents/map/venv/lib/python3.10/site-packages/pip/_vendor/distlib/compat.pyr      s   

r   )	ÚRequestÚurlopenÚURLErrorÚ	HTTPErrorÚHTTPBasicAuthHandlerÚHTTPPasswordMgrÚHTTPHandlerÚHTTPRedirectHandlerÚbuild_opener)ÚHTTPSHandler)Ú
HTMLParser)Úifilter)Úifilterfalse)ÚTextIOWrapper)r   r	   r
   r   r   r   r   r   )
r   r   r   r   r   r    r!   r"   r#   r$   )r   r   r   )Úfilterfalse)Úmatch_hostnameÚCertificateErrorc                   @   s   e Zd ZdS )r,   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r,   `   s    r,   c           
      C   sô   g }| sdS |   d¡}|d |dd… }}| d¡}||kr'tdt| ƒ ƒ‚|s1|  ¡ | ¡ kS |dkr;| d¡ n| d	¡sE| d	¡rN| t |¡¡ n| t |¡ 	d
d¡¡ |D ]
}| t |¡¡ q\t 
dd |¡ d tj¡}	|	 |¡S )zpMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        FÚ.r   r   NÚ*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)ÚsplitÚcountr,   ÚreprÚlowerÚappendÚ
startswithÚreÚescapeÚreplaceÚcompileÚjoinÚ
IGNORECASEÚmatch)
ÚdnÚhostnameÚmax_wildcardsÚpatsÚpartsÚleftmostÚ	remainderÚ	wildcardsÚfragÚpatr   r   r   Ú_dnsname_matchd   s*   


ÿ
rI   c                 C   sä   | st dƒ‚g }|  dd¡}|D ]\}}|dkr%t||ƒr  dS | |¡ q|sJ|  dd¡D ]}|D ]\}}|dkrHt||ƒrC  dS | |¡ q2q.t|ƒdkr^td	|d
 tt|ƒ¡f ƒ‚t|ƒdkrntd||d f ƒ‚tdƒ‚)a=  Verify that *cert* (in decoded format as returned by
        SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
        rules are followed, but IP addresses are not accepted for *hostname*.

        CertificateError is raised on failure. On success, the function
        returns nothing.
        ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDÚsubjectAltNamer   ÚDNSNÚsubjectÚ
commonNamer   z&hostname %r doesn't match either of %sú, zhostname %r doesn't match %rr   z=no appropriate commonName or subjectAltName fields were found)	Ú
ValueErrorÚgetrI   r6   Úlenr,   r<   Úmapr4   )Úcertr@   ÚdnsnamesÚsanÚkeyÚvalueÚsubr   r   r   r+   –   s8   

€

€úþ
þr+   )ÚSimpleNamespacec                   @   ó   e Zd ZdZdd„ ZdS )Ú	ContainerzR
        A generic container for when multiple values need to be returned
        c                 K   s   | j  |¡ d S ©N©Ú__dict__Úupdate)ÚselfÚkwargsr   r   r   Ú__init__È   s   zContainer.__init__N)r-   r.   r/   Ú__doc__rb   r   r   r   r   r[   Ä   s    r[   )Úwhichc                    s"  dd„ }t j ˆ ¡r|ˆ |ƒrˆ S dS |du rt j dt j¡}|s#dS | t j¡}tj	dkr^t j
|vr:| dt j
¡ t j dd¡ t j¡}t‡ fd	d
„|D ƒƒrTˆ g}n‡ fdd„|D ƒ}nˆ g}tƒ }|D ](}t j |¡}||vrŽ| |¡ |D ]}	t j ||	¡}
||
|ƒr�|
    S qyqfdS )aK  Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.

        c                 S   s&   t j | ¡ot  | |¡ot j | ¡ S r\   )ÚosÚpathÚexistsÚaccessÚisdir)ÚfnÚmoder   r   r   Ú_access_checkÝ   s   ÿzwhich.<locals>._access_checkNÚPATHÚwin32r   ÚPATHEXTÚ c                 3   s"   � | ]}ˆ   ¡  |  ¡ ¡V  qd S r\   )r5   Úendswith©Ú.0Úext©Úcmdr   r   Ú	<genexpr>ú   s   €  zwhich.<locals>.<genexpr>c                    s   g | ]}ˆ | ‘qS r   r   rr   ru   r   r   Ú
<listcomp>ý   ó    zwhich.<locals>.<listcomp>)re   rf   ÚdirnameÚenvironrP   Údefpathr2   ÚpathsepÚsysÚplatformÚcurdirÚinsertÚanyÚsetÚnormcaseÚaddr<   )rv   rk   rf   rl   ÚpathextÚfilesÚseenÚdirÚnormdirÚthefileÚnamer   ru   r   rd   Ð   s<   




ÿ€rd   )ÚZipFileÚ	__enter__)Ú
ZipExtFilec                   @   ó$   e Zd Zdd„ Zdd„ Zdd„ ZdS )r�   c                 C   s   | j  |j ¡ d S r\   r]   )r`   Úbaser   r   r   rb     ó   zZipExtFile.__init__c                 C   ó   | S r\   r   ©r`   r   r   r   rŽ     ó   zZipExtFile.__enter__c                 G   ó   |   ¡  d S r\   ©Úclose©r`   Úexc_infor   r   r   Ú__exit__  ó   zZipExtFile.__exit__N)r-   r.   r/   rb   rŽ   r›   r   r   r   r   r�     s    r�   c                   @   r�   )r�   c                 C   r“   r\   r   r”   r   r   r   rŽ   $  r•   zZipFile.__enter__c                 G   r–   r\   r—   r™   r   r   r   r›   '  rœ   zZipFile.__exit__c                 O   s    t j| g|¢R i |¤Ž}t|ƒS r\   )ÚBaseZipFileÚopenr�   )r`   Úargsra   r‘   r   r   r   rž   +  s   zZipFile.openN)r-   r.   r/   rŽ   r›   rž   r   r   r   r   r�   #  s    r�   )Úpython_implementationc                   C   s0   dt jv rdS tjdkrdS t j d¡rdS dS )z6Return a string identifying the Python implementation.ÚPyPyÚjavaÚJythonÚ
IronPythonÚCPython)r~   Úversionre   rŒ   r7   r   r   r   r   r    2  s   

r    )Ú	sysconfig)ÚCallablec                 C   s
   t | tƒS r\   )r   r¨   )Úobjr   r   r   ÚcallableF  ó   
rª   r   ÚmbcsÚstrictÚsurrogateescapec                 C   ó6   t | tƒr| S t | tƒr|  tt¡S tdt| ƒj ƒ‚©Nzexpect bytes or str, not %s)	r   ÚbytesÚ	text_typer   Ú_fsencodingÚ	_fserrorsÚ	TypeErrorÚtyper-   ©Úfilenamer   r   r   ÚfsencodeZ  ó   

ÿr¹   c                 C   r¯   r°   )	r   r²   r±   Údecoder³   r´   rµ   r¶   r-   r·   r   r   r   Úfsdecodec  rº   r¼   )Údetect_encoding)ÚBOM_UTF8Úlookupzcoding[:=]\s*([-\w.]+)c                 C   sH   | dd…   ¡  dd¡}|dks| d¡rdS |dv s | d¡r"d	S | S )
z(Imitates get_normal_name in tokenizer.c.Né   Ú_ú-r   zutf-8-)zlatin-1ú
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-rÃ   )r5   r:   r7   )Úorig_encÚencr   r   r   Ú_get_normal_namet  s   ÿrÆ   c                    sÈ   zˆj j‰W n ty   d‰Y nw d‰ d}d}‡fdd„}‡ ‡fdd„}|ƒ }| t¡r7d‰ |d	d… }d
}|s=|g fS ||ƒ}|rH||gfS |ƒ }|sR||gfS ||ƒ}|r^|||gfS |||gfS )a?  
        The detect_encoding() function is used to detect the encoding that should
        be used to decode a Python source file.  It requires one argument, readline,
        in the same way as the tokenize() generator.

        It will call readline a maximum of twice, and return the encoding used
        (as a string) and a list of any lines (left as bytes) it has read in.

        It detects the encoding from the presence of a utf-8 bom or an encoding
        cookie as specified in pep-0263.  If both a bom and a cookie are present,
        but disagree, a SyntaxError will be raised.  If the encoding cookie is an
        invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
        'utf-8-sig' is returned.

        If no encoding is specified, then the default of 'utf-8' will be returned.
        NFr   c                      s   zˆ ƒ W S  t y   Y dS w )Nó    )ÚStopIterationr   )Úreadliner   r   Úread_or_stop—  s
   ÿz%detect_encoding.<locals>.read_or_stopc                    sä   z|   d¡}W n ty   d}ˆd urd |ˆ¡}t|ƒ‚w t |¡}|s(d S t|d ƒ}zt|ƒ}W n tyQ   ˆd u rGd| }t|ƒ‚d ˆ|¡}t|ƒ‚w ˆ rp|j	dkrlˆd u rcd}t|ƒ‚d ˆ¡}t|ƒ‚|d	7 }|S )
Nr   z'invalid or missing encoding declarationz{} for {!r}r   zunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
r»   ÚUnicodeDecodeErrorÚformatÚSyntaxErrorÚ	cookie_reÚfindallrÆ   r¿   ÚLookupErrorrŒ   )ÚlineÚline_stringÚmsgÚmatchesÚencodingÚcodec)Ú	bom_foundr¸   r   r   Úfind_cookie�  s@   ü
þÿù	

ÿz$detect_encoding.<locals>.find_cookieTr   z	utf-8-sig)Ú__self__rŒ   ÚAttributeErrorr7   r¾   )rÉ   rÕ   ÚdefaultrÊ   rØ   ÚfirstÚsecondr   )r×   r¸   rÉ   r   r½     s6   ÿ&


r½   )r9   é   )r   é   )Úunescape)ÚChainMap)ÚMutableMapping)Úrecursive_reprú...c                    s   ‡ fdd„}|S )zm
            Decorator to make a repr function return fillvalue for a recursive
            call
            c                    sL   t ƒ ‰ ‡‡ ‡fdd„}tˆdƒ|_tˆdƒ|_tˆdƒ|_tˆdi ƒ|_|S )Nc              	      sJ   t | ƒtƒ f}|ˆv rˆ S ˆ |¡ zˆ| ƒ}W ˆ |¡ |S ˆ |¡ w r\   )ÚidÚ	get_identr…   Údiscard)r`   rV   Úresult)Ú	fillvalueÚrepr_runningÚuser_functionr   r   Úwrapperô  s   


ÿz=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr.   rc   r-   Ú__annotations__)rƒ   Úgetattrr.   rc   r-   rí   )rë   rì   ©ré   )rê   rë   r   Údecorating_functionñ  s   z,_recursive_repr.<locals>.decorating_functionr   )ré   rð   r   rï   r   Ú_recursive_reprë  s   rñ   c                   @   s´   e Zd ZdZdd„ Zdd„ Zdd„ Zd'd	d
„Zdd„ Zdd„ Z	dd„ Z
dd„ Zeƒ dd„ ƒZedd„ ƒZdd„ ZeZdd„ Zedd„ ƒZdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ ZdS )(rá   aÍ   A ChainMap groups multiple dicts (or other mappings) together
        to create a single, updateable view.

        The underlying mappings are stored in a list.  That list is public and can
        accessed or updated using the *maps* attribute.  There is no other state.

        Lookups search the underlying mappings successively until a key is found.
        In contrast, writes, updates, and deletions only operate on the first
        mapping.

        c                 G   s   t |ƒpi g| _dS )z˜Initialize a ChainMap by setting *maps* to the given mappings.
            If no mappings are provided, a single empty dictionary is used.

            N)ÚlistÚmaps)r`   ró   r   r   r   rb     s   zChainMap.__init__c                 C   s   t |ƒ‚r\   )ÚKeyError©r`   rV   r   r   r   Ú__missing__  s   zChainMap.__missing__c              	   C   s6   | j D ]}z|| W   S  ty   Y qw |  |¡S r\   )ró   rô   rö   )r`   rV   Úmappingr   r   r   Ú__getitem__  s   
ÿ
zChainMap.__getitem__Nc                 C   s   || v r| | S |S r\   r   ©r`   rV   rÛ   r   r   r   rP   '  s   zChainMap.getc                 C   ó   t tƒ j| jŽ ƒS r\   )rQ   rƒ   Úunionró   r”   r   r   r   Ú__len__*  r’   zChainMap.__len__c                 C   rú   r\   )Úiterrƒ   rû   ró   r”   r   r   r   Ú__iter__-  r’   zChainMap.__iter__c                    s   t ‡ fdd„| jD ƒƒS )Nc                 3   s   � | ]}ˆ |v V  qd S r\   r   )rs   Úm©rV   r   r   rw   1  s   € z(ChainMap.__contains__.<locals>.<genexpr>©r‚   ró   rõ   r   r   r   Ú__contains__0  s   zChainMap.__contains__c                 C   s
   t | jƒS r\   r  r”   r   r   r   Ú__bool__3  r«   zChainMap.__bool__c                 C   s   d  | d tt| jƒ¡¡S )Nz{0.__class__.__name__}({1})rN   )rÌ   r<   rR   r4   ró   r”   r   r   r   Ú__repr__6  s   ÿzChainMap.__repr__c                 G   s   | t j|g|¢R Ž ƒS )z?Create a ChainMap with a single dict created from the iterable.)ÚdictÚfromkeys)ÚclsÚiterablerŸ   r   r   r   r  ;  s   zChainMap.fromkeysc                 C   s&   | j | jd  ¡ g| jdd… ¢R Ž S )zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r   r   N)Ú	__class__ró   Úcopyr”   r   r   r   r
  @  s   &zChainMap.copyc                 C   s   | j i g| j¢R Ž S )z;New ChainMap with a new dict followed by all previous maps.©r	  ró   r”   r   r   r   Ú	new_childF  s   zChainMap.new_childc                 C   s   | j | jdd… Ž S )zNew ChainMap from maps[1:].r   Nr  r”   r   r   r   ÚparentsJ  s   zChainMap.parentsc                 C   s   || j d |< d S )Nr   )ró   )r`   rV   rW   r   r   r   Ú__setitem__O  r’   zChainMap.__setitem__c                 C   s0   z	| j d |= W d S  ty   td |¡ƒ‚w )Nr   ú(Key not found in the first mapping: {!r})ró   rô   rÌ   rõ   r   r   r   Ú__delitem__R  s
   ÿzChainMap.__delitem__c                 C   s(   z| j d  ¡ W S  ty   tdƒ‚w )zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r   z#No keys found in the first mapping.)ró   Úpopitemrô   r”   r   r   r   r  X  s
   ÿzChainMap.popitemc                 G   s8   z| j d j|g|¢R Ž W S  ty   td |¡ƒ‚w )zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r   r  )ró   Úpoprô   rÌ   )r`   rV   rŸ   r   r   r   r  _  s
   ÿzChainMap.popc                 C   s   | j d  ¡  dS )z'Clear maps[0], leaving maps[1:] intact.r   N)ró   Úclearr”   r   r   r   r  f  ó   zChainMap.clearr\   )r-   r.   r/   rc   rb   rö   rø   rP   rü   rþ   r  r  rñ   r  Úclassmethodr  r
  Ú__copy__r  Úpropertyr  r  r  r  r  r  r   r   r   r   rá     s0    



rá   )Úcache_from_sourcec                 C   s6   |   d¡sJ ‚|d u rd}|rd}| | S d}| | S )Nz.pyTÚcÚo)rq   )rf   Údebug_overrideÚsuffixr   r   r   r  p  s   ÿr  )ÚOrderedDict)ræ   )ÚKeysViewÚ
ValuesViewÚ	ItemsViewc                   @   sþ   e Zd ZdZdd„ Zejfdd„Zejfdd„Zdd	„ Zd
d„ Z	dd„ Z
d6dd„Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZeZeƒ Zefdd „Zd7d"d#„Zd7d$d%„Zd&d'„ Zd(d)„ Zed7d*d+„ƒZd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ Z d4d5„ Z!d!S )8r  z)Dictionary that remembers insertion orderc                 O   sp   t |ƒdkrtdt |ƒ ƒ‚z| j W n ty-   g  | _}||dg|dd…< i | _Y nw | j|i |¤Ž dS )zÑInitialize an ordered dictionary.  Signature is the same as for
            regular dictionaries, but keyword arguments are not recommended
            because their insertion order is arbitrary.

            r   z$expected at most 1 arguments, got %dN)rQ   rµ   Ú_OrderedDict__rootrÚ   Ú_OrderedDict__mapÚ_OrderedDict__update)r`   rŸ   ÚkwdsÚrootr   r   r   rb   —  s   


ýzOrderedDict.__init__c                 C   sF   || vr| j }|d }|||g |d<  |d< | j|< || ||ƒ dS )z!od.__setitem__(i, y) <==> od[i]=yr   r   N)r!  r"  )r`   rV   rW   Zdict_setitemr%  Úlastr   r   r   r  §  s
    zOrderedDict.__setitem__c                 C   s0   || |ƒ | j  |¡\}}}||d< ||d< dS )z od.__delitem__(y) <==> del od[y]r   r   N)r"  r  )r`   rV   Zdict_delitemÚ	link_prevÚ	link_nextr   r   r   r  ±  s   
zOrderedDict.__delitem__c                 c   ó:   � | j }|d }||ur|d V  |d }||usdS dS )zod.__iter__() <==> iter(od)r   rÞ   N©r!  ©r`   r%  Úcurrr   r   r   rþ   º  ó   €
þzOrderedDict.__iter__c                 c   r)  )z#od.__reversed__() <==> reversed(od)r   rÞ   Nr*  r+  r   r   r   Ú__reversed__Â  r-  zOrderedDict.__reversed__c                 C   sb   z | j  ¡ D ]}|dd…= q| j}||dg|dd…< | j  ¡  W n	 ty)   Y nw t | ¡ dS )z.od.clear() -> None.  Remove all items from od.N)r"  Ú
itervaluesr!  r  rÚ   r  )r`   Únoder%  r   r   r   r  Ê  s   ÿzOrderedDict.clearTc                 C   s|   | st dƒ‚| j}|r|d }|d }||d< ||d< n|d }|d }||d< ||d< |d }| j|= t | |¡}||fS )z¡od.popitem() -> (k, v), return and remove a (key, value) pair.
            Pairs are returned in LIFO order if last is true or FIFO order if false.

            zdictionary is emptyr   r   rÞ   )rô   r!  r"  r  r  )r`   r&  r%  Úlinkr'  r(  rV   rW   r   r   r   r  Ö  s    
zOrderedDict.popitemc                 C   ó   t | ƒS )zod.keys() -> list of keys in od)rò   r”   r   r   r   Úkeysï  ó   zOrderedDict.keysc                    ó   ‡ fdd„ˆ D ƒS )z#od.values() -> list of values in odc                    s   g | ]}ˆ | ‘qS r   r   ©rs   rV   r”   r   r   rx   õ  ry   z&OrderedDict.values.<locals>.<listcomp>r   r”   r   r”   r   Úvaluesó  r  zOrderedDict.valuesc                    r5  )z.od.items() -> list of (key, value) pairs in odc                    s   g | ]}|ˆ | f‘qS r   r   r6  r”   r   r   rx   ù  ó    z%OrderedDict.items.<locals>.<listcomp>r   r”   r   r”   r   Úitems÷  r  zOrderedDict.itemsc                 C   r2  )z0od.iterkeys() -> an iterator over the keys in od)rý   r”   r   r   r   Úiterkeysû  r4  zOrderedDict.iterkeysc                 c   s   � | D ]}| | V  qdS )z2od.itervalues -> an iterator over the values in odNr   ©r`   Úkr   r   r   r/  ÿ  s   €ÿzOrderedDict.itervaluesc                 c   s   � | D ]	}|| | fV  qdS )z=od.iteritems -> an iterator over the (key, value) items in odNr   r;  r   r   r   Ú	iteritems  s   €ÿzOrderedDict.iteritemsc                  O   sÆ   t | ƒdkrtdt | ƒf ƒ‚| stdƒ‚| d }d}t | ƒdkr%| d }t|tƒr6|D ]}|| ||< q,nt|dƒrI| ¡ D ]}|| ||< q?n|D ]\}}|||< qK| ¡ D ]\}}|||< qXdS )	a—  od.update(E, **F) -> None.  Update od from dict/iterable E and F.

            If E is a dict instance, does:           for k in E: od[k] = E[k]
            If E has a .keys() method, does:         for k in E.keys(): od[k] = E[k]
            Or if E is an iterable of items, does:   for k, v in E: od[k] = v
            In either case, this is followed by:     for k, v in F.items(): od[k] = v

            rÞ   z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)r   r   r   r3  N)rQ   rµ   r   r  Úhasattrr3  r9  )rŸ   r$  r`   ÚotherrV   rW   r   r   r   r_   	  s.   	ÿ
ÿ
ÿ

ÿzOrderedDict.updatec                 C   s0   || v r| | }| |= |S || j u rt|ƒ‚|S )z±od.pop(k[,d]) -> v, remove specified key and return the corresponding value.
            If key is not found, d is returned if given, otherwise KeyError is raised.

            )Ú_OrderedDict__markerrô   )r`   rV   rÛ   rè   r   r   r   r  ,  s   
zOrderedDict.popNc                 C   s   || v r| | S || |< |S )zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr   rù   r   r   r   Ú
setdefault9  s   zOrderedDict.setdefaultc                 C   sj   |si }t | ƒtƒ f}||v rdS d||< z| s#d| jjf W ||= S d| jj|  ¡ f W ||= S ||= w )zod.__repr__() <==> repr(od)rä   r   z%s()z%s(%r))rå   Ú
_get_identr	  r-   r9  )r`   Ú_repr_runningZcall_keyr   r   r   r  @  s   þzOrderedDict.__repr__c                    sX   ‡ fdd„ˆ D ƒ}t ˆ ƒ ¡ }t tƒ ƒD ]}| |d¡ q|r&ˆ j|f|fS ˆ j|ffS )z%Return state information for picklingc                    s   g | ]}|ˆ | g‘qS r   r   ©rs   r<  r”   r   r   rx   P  r8  z*OrderedDict.__reduce__.<locals>.<listcomp>N)Úvarsr
  r  r  r	  )r`   r9  Ú	inst_dictr<  r   r”   r   Ú
__reduce__N  s   zOrderedDict.__reduce__c                 C   s
   |   | ¡S )z!od.copy() -> a shallow copy of od)r	  r”   r   r   r   r
  X  ó   
zOrderedDict.copyc                 C   s   | ƒ }|D ]}|||< q|S )zˆOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
            and values equal to v (which defaults to None).

            r   )r  r  rW   ÚdrV   r   r   r   r  \  s   
zOrderedDict.fromkeysc                 C   s6   t |tƒrt| ƒt|ƒko|  ¡ | ¡ kS t | |¡S )z›od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
            while comparison to a regular mapping is order-insensitive.

            )r   r  rQ   r9  r  Ú__eq__©r`   r?  r   r   r   rJ  g  s   
 zOrderedDict.__eq__c                 C   s
   | |k S r\   r   rK  r   r   r   Ú__ne__p  r«   zOrderedDict.__ne__c                 C   r2  )z@od.viewkeys() -> a set-like object providing a view on od's keys)r  r”   r   r   r   Úviewkeysu  r4  zOrderedDict.viewkeysc                 C   r2  )z<od.viewvalues() -> an object providing a view on od's values)r  r”   r   r   r   Ú
viewvaluesy  r4  zOrderedDict.viewvaluesc                 C   r2  )zBod.viewitems() -> a set-like object providing a view on od's items)r   r”   r   r   r   Ú	viewitems}  r4  zOrderedDict.viewitems)Tr\   )"r-   r.   r/   rc   rb   r  r  r  rþ   r.  r  r  r3  r7  r9  r:  r/  r=  r_   r#  Úobjectr@  r  rA  r  rG  r
  r  r  rJ  rL  rM  rN  rO  r   r   r   r   r  ‹  s<    
	




	r  )ÚBaseConfiguratorÚvalid_identz^[a-z_][a-z0-9_]*$c                 C   s   t  | ¡}|std|  ƒ‚dS )Nz!Not a valid Python identifier: %rT)Ú
IDENTIFIERr>   rO   )r   rÿ   r   r   r   rR  ‡  s   
rR  c                   @   s"   e Zd ZdZdd„ Zddd„ZdS )ÚConvertingDictz A converting dictionary wrapper.c                 C   óJ   t  | |¡}| j |¡}||ur#|| |< t|ƒtttfv r#| |_||_	|S r\   )
r  rø   ÚconfiguratorÚconvertr¶   rT  ÚConvertingListÚConvertingTupleÚparentrV   ©r`   rV   rW   rè   r   r   r   rø   š  ó   
ÿzConvertingDict.__getitem__Nc                 C   sL   t  | ||¡}| j |¡}||ur$|| |< t|ƒtttfv r$| |_||_	|S r\   )
r  rP   rV  rW  r¶   rT  rX  rY  rZ  rV   ©r`   rV   rÛ   rW   rè   r   r   r   rP   ¦  s   
ÿzConvertingDict.getr\   )r-   r.   r/   rc   rø   rP   r   r   r   r   rT  —  s    rT  c                 C   sD   t  | ||¡}| j |¡}||ur t|ƒtttfv r | |_||_	|S r\   )
r  r  rV  rW  r¶   rT  rX  rY  rZ  rV   r]  r   r   r   r  ²  s   
ÿr  c                   @   s"   e Zd ZdZdd„ Zddd„ZdS )	rX  zA converting list wrapper.c                 C   rU  r\   )
rò   rø   rV  rW  r¶   rT  rX  rY  rZ  rV   r[  r   r   r   rø   ¾  r\  zConvertingList.__getitem__éÿÿÿÿc                 C   s<   t  | |¡}| j |¡}||urt|ƒtttfv r| |_|S r\   )	rò   r  rV  rW  r¶   rT  rX  rY  rZ  )r`   ÚidxrW   rè   r   r   r   r  Ê  s   
ÿzConvertingList.popN)r^  )r-   r.   r/   rc   rø   r  r   r   r   r   rX  ¼  s    rX  c                   @   rZ   )rY  zA converting tuple wrapper.c                 C   sB   t  | |¡}| j |¡}||urt|ƒtttfv r| |_||_	|S r\   )
Útuplerø   rV  rW  r¶   rT  rX  rY  rZ  rV   r[  r   r   r   rø   Õ  s   
ÿzConvertingTuple.__getitem__N)r-   r.   r/   rc   rø   r   r   r   r   rY  Ó  s    rY  c                   @   sŒ   e Zd ZdZe d¡Ze d¡Ze d¡Ze d¡Z	e d¡Z
ddd	œZeeƒZd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )rQ  zQ
        The configurator base class which defines some useful defaults.
        z%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$Úext_convertÚcfg_convert)rt   Úcfgc                 C   s   t |ƒ| _| | j_d S r\   )rT  ÚconfigrV  )r`   rd  r   r   r   rb   ó  s   
zBaseConfigurator.__init__c           	   	   C   s´   |  d¡}| d¡}z-|  |¡}|D ]"}|d| 7 }zt||ƒ}W q ty4   |  |¡ t||ƒ}Y qw |W S  tyY   t ¡ dd… \}}td||f ƒ}|||_	|_
|‚w )zl
            Resolve strings to objects using standard import and attribute
            syntax.
            r0   r   r   NzCannot resolve %r: %s)r2   r  Úimporterrî   rÚ   ÚImportErrorr~   rš   rO   Ú	__cause__Ú__traceback__)	r`   r   rŒ   ÚusedÚfoundrG   ÚeÚtbÚvr   r   r   Úresolve÷  s&   



þüzBaseConfigurator.resolvec                 C   s
   |   |¡S )z*Default converter for the ext:// protocol.)rn  ©r`   rW   r   r   r   ra    rH  zBaseConfigurator.ext_convertc                 C   sü   |}| j  |¡}|du rtd| ƒ‚|| ¡ d… }| j| ¡ d  }|r|| j |¡}|r6|| ¡ d  }n1| j |¡}|rg| ¡ d }| j |¡sO|| }nz
t	|ƒ}|| }W n t
yf   || }Y nw |rr|| ¡ d… }ntd||f ƒ‚|s%|S )z*Default converter for the cfg:// protocol.NzUnable to convert %rr   zUnable to convert %r at %r)ÚWORD_PATTERNr>   rO   Úendrd  ÚgroupsÚDOT_PATTERNÚINDEX_PATTERNÚDIGIT_PATTERNÚintrµ   )r`   rW   Úrestrÿ   rI  r_  Únr   r   r   rb    s8   
ÿÿízBaseConfigurator.cfg_convertc                 C   sÌ   t |tƒst |tƒrt|ƒ}| |_|S t |tƒs&t |tƒr&t|ƒ}| |_|S t |tƒs9t |tƒr9t|ƒ}| |_|S t |tƒrd| j	 
|¡}|rd| ¡ }|d }| j |d¡}|rd|d }t| |ƒ}||ƒ}|S )zù
            Convert values to an appropriate type. dicts, lists and tuples are
            replaced by their converting alternatives. Strings are checked to
            see if they have a conversion format and are converted if they do.
            ÚprefixNr  )r   rT  r  rV  rX  rò   rY  r`  Ústring_typesÚCONVERT_PATTERNr>   Ú	groupdictÚvalue_convertersrP   rî   )r`   rW   rÿ   rI  ry  Ú	converterr  r   r   r   rW  4  s2   ï
òÿ
ö
zBaseConfigurator.convertc                    sr   ˆ   d¡}t|ƒs|  |¡}ˆ   dd¡}t‡ fdd„ˆ D ƒƒ}|di |¤Ž}|r7| ¡ D ]
\}}t|||ƒ q,|S )z1Configure an object with a user-supplied factory.z()r0   Nc                    s    g | ]}t |ƒr|ˆ | f‘qS r   )rR  rD  ©rd  r   r   rx   W  s     z5BaseConfigurator.configure_custom.<locals>.<listcomp>r   )r  rª   rn  r  r9  Úsetattr)r`   rd  r  Úpropsra   rè   rŒ   rW   r   r  r   Úconfigure_customP  s   

z!BaseConfigurator.configure_customc                 C   s   t |tƒr	t|ƒ}|S )z0Utility function which converts lists to tuples.)r   rò   r`  ro  r   r   r   Úas_tuple^  s   
zBaseConfigurator.as_tupleN)r-   r.   r/   rc   r8   r;   r{  rp  rs  rt  ru  r}  ÚstaticmethodÚ
__import__re  rb   rn  ra  rb  rW  r‚  rƒ  r   r   r   r   rQ  ß  s$    




þ"rQ  )r   )rä   r\   )�Ú
__future__r   re   r8   r~   Ússlrf  Úversion_infor   Ú
basestringrz  r   r²   Útypesr   Z	file_typeÚ__builtin__ÚbuiltinsÚConfigParserÚconfigparserZ	_backportr   r   r	   r
   r   r   Úurllibr   r   r   r   r   r   r   r   Úurllib2r   r   r   r   r    r!   r"   r#   r$   r%   ÚhttplibÚ	xmlrpclibÚQueueÚqueuer&   ÚhtmlentitydefsZ	raw_inputÚ	itertoolsr'   Úfilterr(   r*   ÚioÚstrr)   Úurllib.parseÚurllib.requestÚurllib.errorÚhttp.clientÚclientÚrequestZxmlrpc.clientZhtml.parserÚhtml.entitiesÚentitiesÚinputr+   r,   rO   rI   rY   r[   rP  rd   ÚF_OKÚX_OKÚzipfiler�   r�   r>  r�   ZBaseZipExtFiler   r    r§   rª   Ú	NameErrorÚcollections.abcr¨   r¹   r¼   rÚ   Úgetfilesystemencodingr³   r´   Útokenizer½   Úcodecsr¾   r¿   r;   rÎ   rÆ   Úhtmlr9   Úcgirà   Úcollectionsrá   râ   Úreprlibrã   rñ   Úimportlib.utilr  Úimpr  Úthreadræ   rB  Údummy_threadÚ_abcollr  r  r   r  Úlogging.configrQ  rR  ÚIrS  rT  r  rò   rX  r`  rY  r   r   r   r   Ú<module>   sT  ÿ$,(0
2Ébÿ	þCÿÿý

	ê
ïlÿ
ÿÝ ÿ€ýÿÿñ  

¤