Edit File: compat.cpython-36.opt-1.pyc
3 )�]ba��������������������@���s��d�dl�mZ�d�dlZd�dlZd�dlZyd�dlZW�n�ek rH���dZY�nX�ejd��dk��r~d�dlmZ�e fZ eZd�dl mZ�d�dlZd�dlZddlmZ�d�dlmZmZmZmZmZ�d�d lmZmZmZm Z m!Z!m"Z"m#Z#�d d��Zd�dl$Z$d�dl$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�dl/Z/d�dl0Z0d�dl1Z2d�dl3m3Z3�d�dl4Z4e5Z5d�dl6m7Z8�d�dl6m9Z:�da;dd��Z<�nd�dl=mZ�e>fZ e>Zd�dl=m?Z�d�dlZd�dlZd�dlZd�dl@mZmZmZm<Z<mZmZmZmZm#Z#�d�dlAm&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-�e�r&d�d lAm.Z.�d�dlBm(Z(m'Z'm"Z"�d�dlCjDZ/d�dlAjEZ$d�dlFjDZ0d�dl2Z2d�dlGm3Z3�d�dlHjIZ4eJZ5d�dl6m:Z:�e8Z8yd�dlmKZKmLZL�W�n8�ek �r����G�dd��deM�ZLdcdd�ZNdd��ZKY�nX�yd�dl mOZP�W�n&�ek �r���G�d d!��d!eQ�ZPY�nX�yd�d"lmRZR�W�n,�ek �rL���ejSejTB�dfd#d$�ZRY�nX�d�d%lUmVZW�eXeWd&��rleWZVn,d�d'lUmYZZ�G�d(d)��d)eZ�ZYG�d*d+��d+eW�ZVyd�d,l[m\Z\�W�n�ek �r����d-d.��Z\Y�nX�yd�dl]Z]W�n"�ek �r����dd/lm]Z]�Y�nX�ye^Z^W�n*�e_k �r*���d�d0l`maZa�d1d2��Z^Y�nX�yejbZbejcZcW�nB�edk �r~���eje��Zfefd3k�rfd4Zgnd5Zgd6d7��Zbd8d9��ZcY�nX�yd�d:lhmiZi�W�nH�ek �r����d�d;ljmkZkmlZl�d�dlZejmd<�Znd=d>��Zod?d@��ZiY�nX�yd�dAlpmqZq�W�n"�ek �r���d�dAlrmqZq�Y�nX�ejddB��ddk��r,e3��jsZsnd�dDlpmsZs�yd�dEl`mtZt�W�nd�ek �r����d�dFl`muZu�yd�dGlvmwZx�W�n �ek �r����dedIdJ�ZxY�nX�G�dKdL��dLeu�ZtY�nX�yd�dMlymzZz�W�n �ek �r����dfdNdO�ZzY�nX�yd�dPl`m{Z{�W�n��ek �rz���yd�dQl|m}Z~�W�n"�ek �r4���d�dQlm}Z~�Y�nX�yd�dRl�m�Z�m�Z�m�Z��W�n�ek �rd���Y�nX�G�dSdT��dTe��Z{Y�nX�yd�dUl�m�Z�m�Z��W�nv�ek �r���ejmdVej��Z�dWdX��Z�G�dYdZ��dZe��Z�dgd[d\�Z�G�d]d^��d^e��Z�G�d_d`��d`e��Z�G�dadb��dbeQ�Z�Y�nX�dS�)h�����)�absolute_importN����)�StringIO)�FileType����)�shutil)�urlparse� urlunparse�urljoin�urlsplit� urlunsplit)�urlretrieve�quote�unquote�url2pathname�pathname2url�ContentTooShortError� splittypec�������������C���s���t�|�t�r|�jd�}�t|��S�)Nzutf-8)� isinstance�unicode�encode�_quote)�s��r����/usr/lib/python3.6/compat.pyr������s���� r���) �Request�urlopen�URLError� HTTPError�HTTPBasicAuthHandler�HTTPPasswordMgr�HTTPHandler�HTTPRedirectHandler�build_opener)�HTTPSHandler)� HTMLParser)�ifilter)�ifilterfalsec�������������C���s<���t�dkrddl}|jd�a�t�j|��}|r4|jdd�S�d|�fS�)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nr���z^(.*)@(.*)$r�������)� _userprog�re�compile�match�group)�hostr*���r,���r���r���r���� splituser4���s���� �r/���)� TextIOWrapper) r���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�Zd�ZdS�)r3���N)�__name__� __module__�__qualname__r���r���r���r���r3���^���s���r3���c������� ������C���s����g�}|�sdS�|�j�d�}|d�|dd���}}|jd�}||krNtdt|�����|sb|�j��|j��kS�|dkrv|jd��n>|jd �s�|jd �r�|jtj|���n|jtj|�j d d���x|D�]}|jtj|���q�W�tj dd j|��d�tj�} | 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[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr3����repr�lower�append� startswithr*����escape�replacer+����join� IGNORECASEr,���) Zdn�hostnameZ max_wildcardsZpats�partsZleftmostZ remainderZ wildcards�fragZpatr���r���r����_dnsname_matchb���s(���� rF���c�������������C���s����|�st�d��g�}|�jdf��}x0|D�](\}}|dkr"t||�r@dS�|j|��q"W�|s�xF|�jdf��D�]6}x0|D�](\}}|dkrjt||�r�dS�|j|��qjW�q`W�t|�dkr�td|d jtt|��f���n*t|�dkr�td ||d�f���ntd��dS�) 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_REQUIREDZsubjectAltNameZDNSNZsubjectZ commonNamer���z&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rr���z=no appropriate commonName or subjectAltName fields were found) � ValueError�getrF���r=����lenr3���rA����mapr;���)ZcertrC���ZdnsnamesZsan�key�value�subr���r���r���r2�������s.���� r2���)�SimpleNamespacec���������������@���s���e�Zd�ZdZdd��ZdS�)� ContainerzR A generic container for when multiple values need to be returned c�������������K���s���|�j�j|��d�S�)N)�__dict__�update)�self�kwargsr���r���r����__init__����s����zContainer.__init__N)r4���r5���r6����__doc__rT���r���r���r���r���rO�������s���rO���)�whichc����������������s"��dd��}t�jj���r&|��|�r"��S�dS�|dkr>t�jjdt�j�}|sFdS�|jt�j�}tj dkr�t�j |krt|jdt�j ��t�jjdd�jt�j�}t��fd d �|D���r���g}q�fdd�|D��}n��g}t ��}xT|D�]L}t�jj|�}||kr�|j|��x(|D�] } t�jj|| �} || |�r�| S�q�W�q�W�dS�) 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�jj|��o$t�j|�|�o$t�jj|���S�)N)�os�path�exists�access�isdir)�fn�moder���r���r���� _access_check����s����zwhich.<locals>._access_checkN�PATHZwin32r���ZPATHEXT��c�������������3���s ���|�]}��j���j|j����V��qd�S�)N)r<����endswith)�.0�ext)�cmdr���r���� <genexpr>����s����zwhich.<locals>.<genexpr>c����������������s���g�|�]}��|��qS�r���r���)rb���rc���)rd���r���r���� <listcomp>����s����zwhich.<locals>.<listcomp>)rW���rX����dirname�environrH����defpathr9����pathsep�sys�platform�curdir�insert�any�set�normcase�addrA���)rd���r]���rX���r^���Zpathext�files�seen�dirZnormdirZthefile�namer���)rd���r���rV�������s8���� rV���)�ZipFile� __enter__)� ZipExtFilec���������������@���s$���e�Zd�Zdd��Zdd��Zdd��ZdS�)ry���c�������������C���s���|�j�j|j���d�S�)N)rP���rQ���)rR����baser���r���r���rT�����s����zZipExtFile.__init__c�������������C���s���|�S�)Nr���)rR���r���r���r���rx�����s����zZipExtFile.__enter__c�������������G���s���|�j����d�S�)N)�close)rR����exc_infor���r���r����__exit__��s����zZipExtFile.__exit__N)r4���r5���r6���rT���rx���r}���r���r���r���r���ry�����s���ry���c���������������@���s$���e�Zd�Zdd��Zdd��Zdd��ZdS�)rw���c�������������C���s���|�S�)Nr���)rR���r���r���r���rx���"��s����zZipFile.__enter__c�������������G���s���|�j����d�S�)N)r{���)rR���r|���r���r���r���r}���%��s����zZipFile.__exit__c�������������O���s���t�j|�f|�|�}t|�S�)N)�BaseZipFile�openry���)rR����argsrS���rz���r���r���r���r���)��s����zZipFile.openN)r4���r5���r6���rx���r}���r���r���r���r���r���rw���!��s���rw���)�python_implementationc���������������C���s0���dt�jkrdS�tjdkrdS�t�jjd�r,dS�dS�)z6Return a string identifying the Python implementation.ZPyPy�javaZJythonZ IronPythonZCPython)rk����versionrW���rv���r>���r���r���r���r���r����0��s���� r����)� sysconfig)�Callablec�������������C���s ���t�|�t�S�)N)r���r����)�objr���r���r����callableD��s����r�����mbcs�strict�surrogateescapec�������������C���s:���t�|�t�r|�S�t�|�t�r$|�jtt�S�tdt|��j���d�S�)Nzexpect bytes or str, not %s) r����bytes� text_typer����_fsencoding� _fserrors� TypeError�typer4���)�filenamer���r���r����fsencodeR��s���� r����c�������������C���s:���t�|�t�r|�S�t�|�t�r$|�jtt�S�tdt|��j���d�S�)Nzexpect bytes or str, not %s) r���r����r�����decoder����r����r����r����r4���)r����r���r���r����fsdecode[��s���� r����)�detect_encoding)�BOM_UTF8�lookupzcoding[:=]\s*([-\w.]+)c�������������C���sH���|�dd��j���jdd�}|dks*|jd�r.dS�|d ks@|jd�rDdS�|�S�)z(Imitates get_normal_name in tokenizer.c.N�����_�-zutf-8zutf-8-�latin-1� iso-8859-1�iso-latin-1�latin-1-�iso-8859-1-�iso-latin-1-)r����r����r����)r����r����r����)r<���r@���r>���)�orig_enc�encr���r���r����_get_normal_namel��s���� r����c����������������s����y�j�j�W�n�tk r$���d�Y�nX�d��d}d}�fdd�}���fdd�}|��}|jt�rpd��|d d��}d }|s||g�fS�||�}|r�||gfS�|��}|s�||gfS�||�}|r�|||gfS�|||gfS�)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. NFzutf-8c������������������s ���y����S��t�k r���dS�X�d�S�)N�����)� StopIterationr���)�readliner���r����read_or_stop���s����z%detect_encoding.<locals>.read_or_stopc����������������s����y|�j�d�}W�n4�tk rB���d}�d�k r6dj|��}t|��Y�nX�tj|�}|sVd�S�t|d��}yt|�}W�n:�tk r�����d�kr�d|�}ndj�|�}t|��Y�nX���r�|j dkr؈d�kr�d}n dj��}t|��|d 7�}|S�) Nzutf-8z'invalid or missing encoding declarationz{} for {!r}r���zunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) r�����UnicodeDecodeError�format�SyntaxError� cookie_re�findallr����r�����LookupErrorrv���)�line�line_string�msgZmatches�encoding�codec)� bom_foundr����r���r����find_cookie���s6���� z$detect_encoding.<locals>.find_cookieTr���z utf-8-sig)�__self__rv����AttributeErrorr>���r����)r����r�����defaultr����r�����first�secondr���)r����r����r����r���r����w��s4���� & r����)r?���r(�������)�unescape)�ChainMap)�MutableMapping)�recursive_repr�...c����������������s�����fdd�}|S�)zm Decorator to make a repr function return fillvalue for a recursive call c����������������sL���t���������fdd�}t�d�|_t�d�|_t�d�|_t�di��|_|S�)Nc����������������sB���t�|��t��f}|�kr��S��j|��z�|��}W�d��j|��X�|S�)N)�id� get_identrr����discard)rR���rK����result)� fillvalue�repr_running� user_functionr���r����wrapper���s���� z=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr5���rU���r4����__annotations__)rp����getattrr5���rU���r4���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�Zd�ZdZdd��Zdd��Zdd��Zd'd d �Zdd��Zd d��Z dd��Z dd��Ze��dd���Z edd���Zdd��ZeZdd��Zedd���Zdd��Zdd ��Zd!d"��Zd#d$��Zd%d&��ZdS�)(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�|�pi�g|�_dS�)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)rR���r����r���r���r���rT��� ��s����zChainMap.__init__c�������������C���s���t�|��d�S�)N)�KeyError)rR���rK���r���r���r����__missing__��s����zChainMap.__missing__c�������������C���s8���x,|�j�D�]"}y||�S��tk r(���Y�qX�qW�|�j|�S�)N)r����r����r����)rR���rK����mappingr���r���r����__getitem__��s���� zChainMap.__getitem__Nc�������������C���s���||�kr|�|�S�|S�)Nr���)rR���rK���r����r���r���r���rH�����s����zChainMap.getc�������������C���s���t�t��j|�j���S�)N)rI���rp����unionr����)rR���r���r���r����__len__"��s����zChainMap.__len__c�������������C���s���t�t��j|�j���S�)N)�iterrp���r����r����)rR���r���r���r����__iter__%��s����zChainMap.__iter__c����������������s���t���fdd�|�jD���S�)Nc�������������3���s���|�]}��|kV��qd�S�)Nr���)rb����m)rK���r���r���re���)��s����z(ChainMap.__contains__.<locals>.<genexpr>)ro���r����)rR���rK���r���)rK���r����__contains__(��s����zChainMap.__contains__c�������������C���s ���t�|�j�S�)N)ro���r����)rR���r���r���r����__bool__+��s����zChainMap.__bool__c�������������C���s���dj�|�djtt|�j���S�)Nz{0.__class__.__name__}({1})z, )r����rA���rJ���r;���r����)rR���r���r���r����__repr__.��s����zChainMap.__repr__c�������������G���s���|�t�j|f|����S�)z?Create a ChainMap with a single dict created from the iterable.)�dict�fromkeys)�cls�iterabler����r���r���r���r����3��s����zChainMap.fromkeysc�������������C���s$���|�j�|�jd�j��f|�jdd�����S�)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r���r���N)� __class__r�����copy)rR���r���r���r���r����8��s����z ChainMap.copyc�������������C���s���|�j�i�f|�j���S�)z;New ChainMap with a new dict followed by all previous maps.)r����r����)rR���r���r���r���� new_child>��s����zChainMap.new_childc�������������C���s���|�j�|�jdd����S�)zNew ChainMap from maps[1:].r���N)r����r����)rR���r���r���r����parentsB��s����zChainMap.parentsc�������������C���s���||�j�d�|<�d�S�)Nr���)r����)rR���rK���rL���r���r���r����__setitem__G��s����zChainMap.__setitem__c�������������C���s8���y|�j�d�|=�W�n"�tk r2���tdj|���Y�nX�d�S�)Nr���z(Key not found in the first mapping: {!r})r����r����r����)rR���rK���r���r���r����__delitem__J��s����zChainMap.__delitem__c�������������C���s0���y|�j�d�j��S��tk r*���td��Y�nX�dS�)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.N)r�����popitemr����)rR���r���r���r���r����P��s����zChainMap.popitemc�������������G���s>���y|�j�d�j|f|���S��tk r8���tdj|���Y�nX�dS�)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r���z(Key not found in the first mapping: {!r}N)r�����popr����r����)rR���rK���r����r���r���r���r����W��s����zChainMap.popc�������������C���s���|�j�d�j���dS�)z'Clear maps[0], leaving maps[1:] intact.r���N)r�����clear)rR���r���r���r���r����^��s����zChainMap.clear)N)r4���r5���r6���rU���rT���r����r����rH���r����r����r����r����r����r�����classmethodr����r�����__copy__r�����propertyr����r����r����r����r����r����r���r���r���r���r�������s(��� r����)�cache_from_sourcec�������������C���s"���|d�krd}|rd}nd}|�|�S�)NF�c�or���)rX����debug_override�suffixr���r���r���r����e��s����r����)�OrderedDict)r����)�KeysView� ValuesView� ItemsViewc���������������@���s����e�Zd�ZdZdd��Zejfdd�Zejfdd�Zdd ��Zd d��Z dd ��Z d6dd�Zdd��Zdd��Z dd��Zdd��Zdd��Zdd��Zdd��ZeZe��Zefdd �Zd7d"d#�Zd8d$d%�Zd&d'��Zd(d)��Zed9d*d+��Zd,d-��Zd.d/��Zd0d1��Zd2d3��Z d4d5��Z!d!S�):r����z)Dictionary that remembers insertion orderc�������������O���sn���t�|�dkrtdt�|����y |�j�W�n6�tk r\���g��|�_}||dg|dd�<�i�|�_Y�nX�|�j||��dS�)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)rI���r�����_OrderedDict__rootr�����_OrderedDict__map�_OrderedDict__update)rR���r�����kwds�rootr���r���r���rT������s���� zOrderedDict.__init__c�������������C���sF���||�kr6|�j�}|d�}|||g�|d<��|d<�|�j|<�||�||��dS�)z!od.__setitem__(i, y) <==> od[i]=yr���r���N)r����r����)rR���rK���rL���Zdict_setitemr�����lastr���r���r���r�������s ���� zOrderedDict.__setitem__c�������������C���s0���||�|��|�j�j|�\}}}||d<�||d<�dS�)z od.__delitem__(y) <==> del od[y]r���r���N)r����r����)rR���rK���Zdict_delitem� link_prev� link_nextr���r���r���r�������s���� zOrderedDict.__delitem__c�������������c���s2���|�j�}|d�}x||k r,|d�V��|d�}qW�dS�)zod.__iter__() <==> iter(od)r���r(���N)r����)rR���r�����currr���r���r���r�������s ���� zOrderedDict.__iter__c�������������c���s2���|�j�}|d�}x||k r,|d�V��|d�}qW�dS�)z#od.__reversed__() <==> reversed(od)r���r(���N)r����)rR���r����r����r���r���r����__reversed__���s ���� zOrderedDict.__reversed__c�������������C���sh���yDx|�j�j��D�]}|dd�=�qW�|�j}||dg|dd�<�|�j�j���W�n�tk rX���Y�nX�tj|���dS�)z.od.clear() -> None. Remove all items from od.N)r����� itervaluesr����r����r����r����)rR���Znoder����r���r���r���r�������s����zOrderedDict.clearTc�������������C���s|���|�st�d��|�j}|r8|d�}|d�}||d<�||d<�n |d�}|d�}||d<�||d<�|d�}|�j|=�tj|�|�}||fS�)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. zdictionary is emptyr���r���r(���)r����r����r����r����r����)rR���r����r�����linkr����r����rK���rL���r���r���r���r�������s ���� zOrderedDict.popitemc�������������C���s���t�|��S�)zod.keys() -> list of keys in od)r����)rR���r���r���r����keys���s����zOrderedDict.keysc����������������s�����fdd���D��S�)z#od.values() -> list of values in odc����������������s���g�|�]}��|��qS�r���r���)rb���rK���)rR���r���r���rf������s����z&OrderedDict.values.<locals>.<listcomp>r���)rR���r���)rR���r����values���s����zOrderedDict.valuesc����������������s�����fdd���D��S�)z.od.items() -> list of (key, value) pairs in odc����������������s���g�|�]}|��|�f�qS�r���r���)rb���rK���)rR���r���r���rf������s����z%OrderedDict.items.<locals>.<listcomp>r���)rR���r���)rR���r����items���s����zOrderedDict.itemsc�������������C���s���t�|��S�)z0od.iterkeys() -> an iterator over the keys in od)r����)rR���r���r���r����iterkeys���s����zOrderedDict.iterkeysc�������������c���s���x|�D�]}|�|�V��qW�dS�)z2od.itervalues -> an iterator over the values in odNr���)rR����kr���r���r���r�������s���� zOrderedDict.itervaluesc�������������c���s ���x|�D�]}||�|�fV��qW�dS�)z=od.iteritems -> an iterator over the (key, value) items in odNr���)rR���r��r���r���r���� iteritems���s���� zOrderedDict.iteritemsc��������������O���s����t�|��dkr tdt�|��f���n|�s,td��|�d�}f�}t�|��dkrL|�d�}t|t�rrx^|D�]}||�||<�q\W�nDt|d�r�x8|j��D�]}||�||<�q�W�nx|D�]\}}|||<�q�W�x|j��D�]\}}|||<�q�W�dS�)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����N)rI���r����r���r�����hasattrr����r��)r����r����rR����otherrK���rL���r���r���r���rQ������s&���� zOrderedDict.updatec�������������C���s0���||�kr|�|�}|�|=�|S�||�j�kr,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����)rR���rK���r����r����r���r���r���r����!��s���� zOrderedDict.popNc�������������C���s���||�kr|�|�S�||�|<�|S�)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr���)rR���rK���r����r���r���r���� setdefault.��s����zOrderedDict.setdefaultc�������������C���s^���|si�}t�|��t��f}||kr"dS�d||<�z&|�s>d|�jjf�S�d|�jj|�j��f�S�||=�X�dS�)zod.__repr__() <==> repr(od)z...r���z%s()z%s(%r)N)r����� _get_identr����r4���r��)rR���Z _repr_runningZcall_keyr���r���r���r����5��s�����zOrderedDict.__repr__c����������������s\�����fdd���D��}t����j��}xt�t���D�]}|j|d��q*W�|rP��j|f|fS���j|ffS�)z%Return state information for picklingc����������������s���g�|�]}|��|�g�qS�r���r���)rb���r��)rR���r���r���rf���E��s����z*OrderedDict.__reduce__.<locals>.<listcomp>N)�varsr����r����r����r����)rR���r��Z inst_dictr��r���)rR���r���� __reduce__C��s����zOrderedDict.__reduce__c�������������C���s ���|�j�|��S�)z!od.copy() -> a shallow copy of od)r����)rR���r���r���r���r����M��s����zOrderedDict.copyc�������������C���s ���|���}x|D�]}|||<�qW�|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����rL����drK���r���r���r���r����Q��s���� zOrderedDict.fromkeysc�������������C���s6���t�|t�r*t|��t|�ko(|�j��|j��kS�tj|�|�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����rI���r��r�����__eq__)rR���r��r���r���r���r ��\��s���� zOrderedDict.__eq__c�������������C���s ���|�|k�S�)Nr���)rR���r��r���r���r����__ne__e��s����zOrderedDict.__ne__c�������������C���s���t�|��S�)z@od.viewkeys() -> a set-like object providing a view on od's keys)r����)rR���r���r���r����viewkeysj��s����zOrderedDict.viewkeysc�������������C���s���t�|��S�)z<od.viewvalues() -> an object providing a view on od's values)r����)rR���r���r���r���� viewvaluesn��s����zOrderedDict.viewvaluesc�������������C���s���t�|��S�)zBod.viewitems() -> a set-like object providing a view on od's items)r����)rR���r���r���r���� viewitemsr��s����zOrderedDict.viewitems)T)N)N)N)"r4���r5���r6���rU���rT���r����r����r����r����r����r����r����r����r���r��r��r����r��rQ���r�����objectr��r����r��r����r��r����r����r����r ��r��r��r��r��r���r���r���r���r�������s:��� r����)�BaseConfigurator�valid_identz^[a-z_][a-z0-9_]*$c�������������C���s���t�j|��}|std|����dS�)Nz!Not a valid Python identifier: %rT)� IDENTIFIERr,���rG���)r���r����r���r���r���r��|��s���� r��c���������������@���s"���e�Zd�ZdZdd��Zddd�ZdS�)�ConvertingDictz A converting dictionary wrapper.c�������������C���sJ���t�j|�|�}|�jj|�}||k rF||�|<�t|�tttfkrF|�|_||_ |S�)N) r����r�����configurator�convertr����r���ConvertingList�ConvertingTuple�parentrK���)rR���rK���rL���r����r���r���r���r�������s���� zConvertingDict.__getitem__Nc�������������C���sL���t�j|�||�}|�jj|�}||k rH||�|<�t|�tttfkrH|�|_||_ |S�)N) r����rH���r��r��r����r��r��r��r��rK���)rR���rK���r����rL���r����r���r���r���rH������s���� zConvertingDict.get)N)r4���r5���r6���rU���r����rH���r���r���r���r���r�����s���r��c�������������C���sD���t�j|�||�}|�jj|�}||k r@t|�tttfkr@|�|_||_ |S�)N) r����r����r��r��r����r��r��r��r��rK���)rR���rK���r����rL���r����r���r���r���r�������s���� r����c���������������@���s"���e�Zd�ZdZdd��Zd dd�ZdS�) r��zA converting list wrapper.c�������������C���sJ���t�j|�|�}|�jj|�}||k rF||�|<�t|�tttfkrF|�|_||_ |S�)N) r����r����r��r��r����r��r��r��r��rK���)rR���rK���rL���r����r���r���r���r�������s���� zConvertingList.__getitem__r���c�������������C���s<���t�j|�|�}|�jj|�}||k r8t|�tttfkr8|�|_|S�)N) r����r����r��r��r����r��r��r��r��)rR����idxrL���r����r���r���r���r�������s���� zConvertingList.popN���)r��)r4���r5���r6���rU���r����r����r���r���r���r���r�����s���r��c���������������@���s���e�Zd�ZdZdd��ZdS�)r��zA converting tuple wrapper.c�������������C���sB���t�j|�|�}|�jj|�}||k r>t|�tttfkr>|�|_||_ |S�)N) �tupler����r��r��r����r��r��r��r��rK���)rR���rK���rL���r����r���r���r���r�������s���� zConvertingTuple.__getitem__N)r4���r5���r6���rU���r����r���r���r���r���r�����s���r��c���������������@���s����e�Zd�ZdZejd�Zejd�Zejd�Zejd�Z ejd�Z ddd �Zee �Zd d��Zdd ��Zdd��Zdd��Zdd��Zdd��Zdd��ZdS�)r��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)rc���Zcfgc�������������C���s���t�|�|�_|�|�j_d�S�)N)r���configr��)rR���r!��r���r���r���rT������s���� zBaseConfigurator.__init__c������� ������C���s����|j�d�}|jd�}y`|�j|�}xP|D�]H}|d|�7�}yt||�}W�q&�tk rl���|�j|��t||�}Y�q&X�q&W�|S��tk r����tj��dd��\}}td||f��}||�|_ |_ |�Y�nX�dS�)zl Resolve strings to objects using standard import and attribute syntax. r7���r���r���NzCannot resolve %r: %s)r9���r�����importerr����r�����ImportErrorrk���r|���rG���� __cause__� __traceback__) rR���r���rv���Zused�foundrE����e�tb�vr���r���r����resolve���s"���� zBaseConfigurator.resolvec�������������C���s ���|�j�|�S�)z*Default converter for the ext:// protocol.)r*��)rR���rL���r���r���r���r����s����zBaseConfigurator.ext_convertc�������������C���s��|}|�j�j|�}|dkr&td|���n�||j��d��}|�j|j��d��}x�|r�|�jj|�}|rp||j��d��}nd|�jj|�}|r�|j��d�}|�jj|�s�||�}n2yt |�}||�}W�n�t k r����||�}Y�nX�|r�||j��d��}qJtd||f���qJW�|S�)z*Default converter for the cfg:// protocol.NzUnable to convert %rr���zUnable to convert %r at %r)�WORD_PATTERNr,���rG����endr!���groups�DOT_PATTERN� INDEX_PATTERN� DIGIT_PATTERN�intr����)rR���rL����restr����r��r���nr���r���r���r ����s2���� zBaseConfigurator.cfg_convertc�������������C���s����t�|t��r&t�|t�r&t|�}|�|_n�t�|t��rLt�|t�rLt|�}|�|_n|t�|t��rrt�|t�rrt|�}|�|_nVt�|t�r�|�j j |�}|r�|j��}|d�}|�jj |d�}|r�|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��r���string_types�CONVERT_PATTERNr,���� groupdict�value_convertersrH���r����)rR���rL���r����r��r4��Z converterr����r���r���r���r��)��s*���� zBaseConfigurator.convertc����������������sr�����j�d�}t|�s|�j|�}��j�dd�}t��fdd���D���}|f�|�}|rnx |j��D�]\}}t|||��qVW�|S�)z1Configure an object with a user-supplied factory.z()r7���Nc����������������s ���g�|�]}t�|�r|��|�f�qS�r���)r��)rb���r��)r!��r���r���rf���L��s����z5BaseConfigurator.configure_custom.<locals>.<listcomp>)r����r����r*��r����r���setattr)rR���r!��r����ZpropsrS���r����rv���rL���r���)r!��r����configure_customE��s���� z!BaseConfigurator.configure_customc�������������C���s���t�|t�rt|�}|S�)z0Utility function which converts lists to tuples.)r���r����r��)rR���rL���r���r���r����as_tupleS��s���� zBaseConfigurator.as_tupleN)r4���r5���r6���rU���r*���r+���r6��r+��r.��r/��r0��r8���staticmethod� __import__r"��rT���r*��r��r ��r��r:��r;��r���r���r���r���r�����s ��� "r��)r���)r���r����)r����)N)N)�Z __future__r���rW���r*���rk���Zsslr#���version_infor���Z basestringr5��r���r�����typesr���Z file_typeZ__builtin__�builtinsZConfigParserZconfigparserZ _backportr���r���r ���r ���r���r���Zurllibr ���r���r���r���r���r���r���r���Zurllib2r���r���r���r���r���r ���r!���r"���r#���r$���ZhttplibZ xmlrpclibZQueueZqueuer%���ZhtmlentitydefsZ raw_input� itertoolsr&����filterr'���r1���r)���r/����io�strr0���Zurllib.parseZurllib.requestZurllib.errorZhttp.clientZclientZrequestZ xmlrpc.clientZhtml.parserZ html.entitiesZentities�inputr2���r3���rG���rF���rN���rO���r��rV����F_OK�X_OKZzipfilerw���r~���r��ry���ZBaseZipExtFilerl���r����r����r����� NameError�collectionsr����r����r����r�����getfilesystemencodingr����r�����tokenizer�����codecsr����r����r+���r����r����Zhtmlr?���Zcgir����r����r�����reprlibr����r����Zimpr����r����Zthreadr����r ��Zdummy_threadZ_abcollr����r����r����r����Zlogging.configr��r���Ir��r��r����r����r��r��r��r���r���r���r����<module>���s&�� $,,0 2+A [ b �w