o
    ä§Êh¼¡  ã                   @   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: da;dd„ Z<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m#Z# d dlAm&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z- e�rd dlAm.Z. d dlBm(Z(m'Z'm"Z" d dlCmDZ/ d dlAmEZ$ d dlFmDZ0 d dl2Z2d dlGm3Z3 d dlHmIZ4 eJZ5d dl6m:Z: e8Z8z
d dlmKZKmLZL W n e�yj   G dd„ deMƒZLdddd„ZNdd„ ZKY nw zd dlmOZP W n e�y…   G d d!„ d!eQƒZPY nw zd d"lmRZR W n e�y£   ejSejTB dfd#d$„ZRY nw d d%lUmVZW eXeWd&ƒ�r³eWZVnd d'lUmYZZ G d(d)„ d)eZƒZYG d*d+„ d+eWƒZVzd d,l[m\Z\ W n e�yß   d-d.„ Z\Y 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 d0l`maZa d1d2„ Z^Y nw zejbZbejcZcW n# ed�y;   e e¡ �p&d3Zfefd4k�r/d5Zgnd6Zgd7d8„ Zbd9d:„ ZcY nw zd d;lhmiZi W n# e�yg   d d<ljmkZkmlZl d dlZe md=¡Znd>d?„ Zod@dA„ ZiY nw zd dBlpmqZq W n e�y€   d dBlrmqZq Y nw ejddC… dDk �r�e3ƒ jsZsnd dElpmsZs zd dFl`mtZt W n0 e�yÎ   d dGl`muZu zd dHlvmwZx W n e�yÃ   dedJdK„ZxY nw G dLdM„ dMeuƒZtY nw zd dNlymzZz W n" e�yù   zd dNl{mzZz W n e�yö   dfdOdP„ZzY nw Y nw zd dQl`m|Z| W nB e�yD   zd dRl}m~Z W n e�y"   d dRl€m~Z Y nw zd dSl�m‚Z‚mƒZƒm„Z„ W n
 e�y9   Y nw G dTdU„ dUe…ƒZ|Y nw zd dVl†m‡Z‡mˆZˆ W dS  e�y‹   e mdWej‰¡ZŠdXdY„ ZˆG dZd[„ d[e…ƒZ‹dfd\d]„ZŒG d^d_„ d_e�ƒZŽG d`da„ dae�ƒZ�G dbdc„ dceQƒZ‡Y dS w )gé    )Ú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   ú@/var/www/html/env/lib/python3.10/site-packages/distlib/compat.pyr      s   

r   )	ÚRequestÚurlopenÚURLErrorÚ	HTTPErrorÚHTTPBasicAuthHandlerÚHTTPPasswordMgrÚHTTPHandlerÚHTTPRedirectHandlerÚbuild_opener)ÚHTTPSHandler)Ú
HTMLParser)Úifilter)Úifilterfalsec                 C   s<   t du rddl}| d¡a t  | ¡}|r| dd¡S d| fS )zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nr   z^(.*)@(.*)$r   é   )Ú	_userprogÚreÚcompileÚmatchÚgroup)Úhostr+   r-   r   r   r   Ú	splituser4   s   

r0   )ÚTextIOWrapper)	r   r	   r
   r0   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 )r4   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r4   ^   s    r4   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Úcountr4   ÚreprÚlowerÚappendÚ
startswithr+   ÚescapeÚreplacer,   ÚjoinÚ
IGNORECASEr-   )
ÚdnÚhostnameÚmax_wildcardsÚpatsÚpartsÚleftmostÚ	remainderÚ	wildcardsÚfragÚpatr   r   r   Ú_dnsname_matchb   s*   


ÿ
rN   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ÚgetrN   r>   Úlenr4   rB   Úmapr<   )ÚcertrE   ÚdnsnamesÚsanÚkeyÚvalueÚsubr   r   r   r3   ”   s8   

€

€úþ
þr3   )Ú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)r5   r6   r7   Ú__doc__rg   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 ra   )Ú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 ra   )r=   Úendswith©Ú.0Úext©Úcmdr   r   Ú	<genexpr>ø   s   €  zwhich.<locals>.<genexpr>c                    s   g | ]}ˆ | ‘qS r   r   rw   rz   r   r   Ú
<listcomp>û   ó    zwhich.<locals>.<listcomp>)rj   rk   ÚdirnameÚenvironrU   Údefpathr:   ÚpathsepÚsysÚplatformÚcurdirÚinsertÚanyÚsetÚnormcaseÚaddrB   )r{   rp   rk   rq   ÚpathextÚfilesÚseenÚdirÚnormdirÚthefileÚnamer   rz   r   ri   Î   s<   




ÿ€ri   )Ú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 ra   rb   )re   Úbaser   r   r   rg     ó   zZipExtFile.__init__c                 C   ó   | S ra   r   ©re   r   r   r   r“     ó   zZipExtFile.__enter__c                 G   ó   |   ¡  d S ra   ©Úclose©re   Úexc_infor   r   r   Ú__exit__  ó   zZipExtFile.__exit__N)r5   r6   r7   rg   r“   r    r   r   r   r   r”     s    r”   c                   @   r•   )r’   c                 C   r˜   ra   r   r™   r   r   r   r“   "  rš   zZipFile.__enter__c                 G   r›   ra   rœ   rž   r   r   r   r    %  r¡   zZipFile.__exit__c                 O   s    t j| g|¢R i |¤Ž}t|ƒS ra   )ÚBaseZipFileÚopenr”   )re   Úargsrf   r–   r   r   r   r£   )  s   zZipFile.openN)r5   r6   r7   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ƒ   Úversionrj   r‘   r?   r   r   r   r   r¥   0  s   

r¥   )Ú	sysconfig)ÚCallablec                 C   s
   t | tƒS ra   )r   r­   )Úobjr   r   r   ÚcallableD  ó   
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Útyper5   ©Úfilenamer   r   r   ÚfsencodeX  ó   

ÿr¾   c                 C   r´   rµ   )	r   r·   r¶   Údecoder¸   r¹   rº   r»   r5   r¼   r   r   r   Úfsdecodea  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È   )r=   rA   r?   )Úorig_encÚencr   r   r   Ú_get_normal_namer  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‘   ÚAttributeErrorr?   rÃ   )rÎ   rÚ   ÚdefaultrÏ   rÝ   ÚfirstÚsecondr   )rÜ   r½   rÎ   r   rÂ   }  s6   ÿ&


rÂ   )r@   r)   )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 ra   )ÚidÚ	get_identrŠ   Údiscard)re   r[   Úresult)Ú	fillvalueÚrepr_runningÚuser_functionr   r   Úwrapperò  s   


ÿz=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr6   rh   r5   Ú__annotations__)rˆ   Úgetattrr6   rh   r5   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)re   r÷   r   r   r   rg     s   zChainMap.__init__c                 C   s   t |ƒ‚ra   )ÚKeyError©re   r[   r   r   r   Ú__missing__  s   zChainMap.__missing__c              	   C   s6   | j D ]}z|| W   S  ty   Y qw |  |¡S ra   )r÷   rø   rú   )re   r[   Úmappingr   r   r   Ú__getitem__  s   
ÿ
zChainMap.__getitem__Nc                 C   s   || v r| | S |S ra   r   ©re   r[   rà   r   r   r   rU   %  s   zChainMap.getc                 C   ó   t tƒ j| jŽ ƒS ra   )rV   rˆ   Úunionr÷   r™   r   r   r   Ú__len__(  r—   zChainMap.__len__c                 C   rþ   ra   )Ú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 ra   r   )rx   Úm©r[   r   r   r|   /  s   € z(ChainMap.__contains__.<locals>.<genexpr>©r‡   r÷   rù   r   r  r   Ú__contains__.  s   zChainMap.__contains__c                 C   s
   t | jƒS ra   r  r™   r   r   r   Ú__bool__1  r°   zChainMap.__bool__c                 C   s   d  | d tt| jƒ¡¡S )Nz{0.__class__.__name__}({1})rS   )rÑ   rB   rW   r<   r÷   r™   r   r   r   Ú__repr__4  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
  9  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_childD  s   zChainMap.new_childc                 C   s   | j | jdd… Ž S )zNew ChainMap from maps[1:].r   Nr  r™   r   r   r   ÚparentsH  s   zChainMap.parentsc                 C   s   || j d |< d S )Nr   )r÷   )re   r[   r\   r   r   r   Ú__setitem__M  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__P  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  V  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Ñ   )re   r[   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  d  ó   zChainMap.clearra   )r5   r6   r7   rh   rg   rú   rü   rU   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)rv   )rk   Údebug_overrideÚsuffixr   r   r   r  n  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)rV   rº   Ú_OrderedDict__rootrß   Ú_OrderedDict__mapÚ_OrderedDict__update)re   r¤   ÚkwdsÚrootr   r   r   rg   •  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&  )re   r[   r\   Ú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  )re   r[   Ú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%  ©re   r)  Úcurrr   r   r   r  ¸  ó   €
þzOrderedDict.__iter__c                 c   r/  )z#od.__reversed__() <==> reversed(od)r   r)   Nr0  r1  r   r   r   Ú__reversed__À  r3  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	  )re   Ú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  )re   r+  r)  Úlinkr-  r.  r[   r\   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   ©rx   r[   r™   r   r   r}   ó  r~   z&OrderedDict.values.<locals>.<listcomp>r   r™   r   r™   r   Úvaluesñ  r  zOrderedDict.valuesc                    r;  )z.od.items() -> list of (key, value) pairs in odc                    s   g | ]}|ˆ | f‘qS r   r   r<  r™   r   r   r}   ÷  ó    z%OrderedDict.items.<locals>.<listcomp>r   r™   r   r™   r   Úitemsõ  r  zOrderedDict.itemsc                 C   r8  )z0od.iterkeys() -> an iterator over the keys in od)r  r™   r   r   r   Úiterkeysù  r:  zOrderedDict.iterkeysc                 c   s   � | D ]}| | V  qdS )z2od.itervalues -> an iterator over the values in odNr   ©re   Úkr   r   r   r5  ý  s   €ÿzOrderedDict.itervaluesc                 c   s   � | D ]	}|| | fV  qdS )z=od.iteritems -> an iterator over the (key, value) items in odNr   rA  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   r9  N)rV   rº   r   r	  Úhasattrr9  r?  )r¤   r(  re   Úotherr[   r\   r   r   r   rd     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ø   )re   r[   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   Ú
setdefault7  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  r5   r?  )re   Ú_repr_runningÚ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   ©rx   rB  r™   r   r   r}   N  r>  z*OrderedDict.__reduce__.<locals>.<listcomp>N)Úvarsr  r!  r  r  )re   r?  Ú	inst_dictrB  r   r™   r   Ú
__reduce__L  s   zOrderedDict.__reduce__c                 C   s
   |   | ¡S )z!od.copy() -> a shallow copy of od)r  r™   r   r   r   r  V  ó   
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  r\   Údr[   r   r   r   r
  Z  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!  rV   r?  r	  Ú__eq__©re   rE  r   r   r   rQ  e  s   
 zOrderedDict.__eq__c                 C   s
   | |k S ra   r   rR  r   r   r   Ú__ne__n  r°   zOrderedDict.__ne__c                 C   r8  )z@od.viewkeys() -> a set-like object providing a view on od's keys)r"  r™   r   r   r   Úviewkeyss  r:  zOrderedDict.viewkeysc                 C   r8  )z<od.viewvalues() -> an object providing a view on od's values)r#  r™   r   r   r   Ú
viewvaluesw  r:  zOrderedDict.viewvaluesc                 C   r8  )zBod.viewitems() -> a set-like object providing a view on od's items)r$  r™   r   r   r   Ú	viewitems{  r:  zOrderedDict.viewitems)Tra   )"r5   r6   r7   rh   rg   r	  r  r  r  r4  r  r  r9  r=  r?  r@  r5  rC  rd   r'  ÚobjectrF  r  rG  r  rN  r  r  r
  rQ  rS  rT  rU  rV  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-   rT   )r   r  r   r   r   rY  …  s   
rY  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 ra   )
r	  rü   ÚconfiguratorÚconvertr»   r[  ÚConvertingListÚConvertingTupleÚparentr[   ©re   r[   r\   rì   r   r   r   rü   ˜  ó   
ÿzConvertingDict.__getitem__Nc                 C   sL   t  | ||¡}| j |¡}||ur$|| |< t|ƒtttfv r$| |_||_	|S ra   )
r	  rU   r]  r^  r»   r[  r_  r`  ra  r[   ©re   r[   rà   r\   rì   r   r   r   rU   ¤  s   
ÿzConvertingDict.getra   )r5   r6   r7   rh   rü   rU   r   r   r   r   r[  •  s    r[  c                 C   sD   t  | ||¡}| j |¡}||ur t|ƒtttfv r | |_||_	|S ra   )
r	  r  r]  r^  r»   r[  r_  r`  ra  r[   rd  r   r   r   r  °  s   
ÿr  c                   @   s"   e Zd ZdZdd„ Zddd„ZdS )	r_  zA converting list wrapper.c                 C   r\  ra   )
rö   rü   r]  r^  r»   r[  r_  r`  ra  r[   rb  r   r   r   rü   ¼  rc  zConvertingList.__getitem__éÿÿÿÿc                 C   s<   t  | |¡}| j |¡}||urt|ƒtttfv r| |_|S ra   )	rö   r  r]  r^  r»   r[  r_  r`  ra  )re   Úidxr\   rì   r   r   r   r  È  s   
ÿzConvertingList.popN)re  )r5   r6   r7   rh   rü   r  r   r   r   r   r_  º  s    r_  c                   @   r_   )r`  zA converting tuple wrapper.c                 C   sB   t  | |¡}| j |¡}||urt|ƒtttfv r| |_||_	|S ra   )
Útuplerü   r]  r^  r»   r[  r_  r`  ra  r[   rb  r   r   r   rü   Ó  s   
ÿzConvertingTuple.__getitem__N)r5   r6   r7   rh   rü   r   r   r   r   r`  Ñ  s    r`  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 )rX  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)ry   Úcfgc                 C   s   t |ƒ| _| | j_d S ra   )r[  Úconfigr]  )re   rk  r   r   r   rg   ñ  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.
            r8   r   r   NzCannot resolve %r: %s)r:   r  Úimporterrò   rß   ÚImportErrorrƒ   rŸ   rT   Ú	__cause__Ú__traceback__)	re   r   r‘   ÚusedÚfoundrL   ÚeÚtbÚvr   r   r   Úresolveõ  s&   



þüzBaseConfigurator.resolvec                 C   s
   |   |¡S )z*Default converter for the ext:// protocol.)ru  ©re   r\   r   r   r   rh    rO  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-   rT   Úendrk  ÚgroupsÚDOT_PATTERNÚINDEX_PATTERNÚDIGIT_PATTERNÚintrº   )re   r\   Úrestr  rP  rf  Únr   r   r   ri    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   r[  r	  r]  r_  rö   r`  rg  Ústring_typesÚCONVERT_PATTERNr-   Ú	groupdictÚvalue_convertersrU   rò   )re   r\   r  rP  r€  Ú	converterr   r   r   r   r^  2  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()r8   Nc                    s    g | ]}t |ƒr|ˆ | f‘qS r   )rY  rK  ©rk  r   r   r}   U  s     z5BaseConfigurator.configure_custom.<locals>.<listcomp>r   )r  r¯   ru  r	  r?  Úsetattr)re   rk  r  Úpropsrf   rì   r‘   r\   r   r†  r   Úconfigure_customN  s   

z!BaseConfigurator.configure_customc                 C   s   t |tƒr	t|ƒ}|S )z0Utility function which converts lists to tuples.)r   rö   rg  rv  r   r   r   Úas_tuple\  s   
zBaseConfigurator.as_tupleN)r5   r6   r7   rh   r+   r,   r‚  rw  rz  r{  r|  r„  ÚstaticmethodÚ
__import__rl  rg   ru  rh  ri  r^  r‰  rŠ  r   r   r   r   rX  Ý  s$    




þ"rX  )r   )rè   ra   )‘Ú
__future__r   rj   r+   rƒ   Ússlrm  Úversion_infor   Ú
basestringr�  r   r·   Útypesr   Ú	file_typeÚ__builtin__ÚbuiltinsÚConfigParserÚconfigparserÚ	_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&   ÚhtmlentitydefsÚ	raw_inputÚ	itertoolsr'   Úfilterr(   r2   r*   r0   ÚioÚstrr1   Úurllib.parseÚurllib.requestÚurllib.errorÚhttp.clientÚclientÚrequestÚxmlrpc.clientÚhtml.parserÚhtml.entitiesÚentitiesÚinputr3   r4   rT   rN   r^   r`   rW  ri   ÚF_OKÚX_OKÚzipfiler’   r¢   rD  r”   ÚBaseZipExtFiler„   r¥   r¬   r¯   Ú	NameErrorÚcollectionsr­   r¾   rÁ   rß   Úgetfilesystemencodingr¸   r¹   ÚtokenizerÂ   ÚcodecsrÃ   rÄ   r,   rÓ   rË   Úhtmlr@   Úcgirä   rå   ræ   Úreprlibrç   rõ   Úimportlib.utilr  Úimpr!  Úthreadrê   rH  Údummy_threadÚ_abcollr"  r#  r$  r	  Úlogging.configrX  rY  ÚIrZ  r[  r  rö   r_  rg  r`  r   r   r   r   Ú<module>   sX  ÿ$,
,0
2Ébÿ	þCÿÿý

	ê
ïlÿ
ÿÝ ÿ€ýÿÿñ  

¤